According to the documentation mod.const_get(sym) \"Returns the value of the named constant in mod.\"
mod.const_get(sym)
I also know that const_get by default may
const_get
I came up with the following script to load name spaced constants:
def load_constant(name) parts = name.split('::') klass = Module.const_get(parts.shift) klass = klass.const_get(parts.shift) until parts.empty? klass end