Source code of the color ramp node
The code you're looking for is here on line 322 (the do_colorband function).

This is the definition of the node itself, and the operation is implemented here: apparently it samples a colourband texture using the input as texture coordinates.