const_get(p1)
public
Returns the value of the named constant in mod.
Math.const_get(:PI)
Show source
/*
* call-seq:
* mod.const_get(sym) => obj
*
* Returns the value of the named constant in <i>mod</i>.
*
* Math.const_get(:PI)
*/
static VALUE
rb_mod_const_get(mod, name)
VALUE mod, name;
{
ID id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_name_error(id, "wrong constant name %s", rb_id2name(id));
}
return rb_const_get(mod, id);
}