Tuesday, June 15, 2010

Ruby get all global constants

Object.constants.sort.uniq
Object.const_get("RUBY_VERSION") 

Object can of course be replaced with any class to see its local constants

No comments:

Post a Comment