method

const_get

v1_9_3_125 - Show latest stable - Class: Module
const_get(p1, p2 = v2)
public

Checks for a constant with the given name in mod If inherit is set, the lookup will also search the ancestors (and Object if mod is a Module.)

The value of the constant is returned if a definition is found, otherwise a NameError is raised.

Math.const_get(:PI)   #=> 3.14159265358979