inguansoft
Journey on entrepreneurship by doing Software that changes the world
Monday, February 21, 2011
dynamic access to constants on ruby
How to verify if the constant is available?
self.const_defined?('DEFAULT_VALUES')
How to call for it: simple way: MyClass::CONSTANT
Dynamic cool way: MyClass.const_get("CONSTANT")
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment