const_set

mod.const_set(sym, obj) รข obj
Instance Public methods

Sets the named constant to the given object, returning that object. Creates a new constant if no constant with the given name previously existed.

Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0)   #=> 3.14285714285714
Math::HIGH_SCHOOL_PI - Math::PI              #=> 0.00126448926734968
doc_ruby_on_rails
2015-04-19 03:06:26
Comments
Leave a Comment

Please login to continue.