Skip to content

Instantly share code, notes, and snippets.

@pirj
Created September 19, 2010 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pirj/586977 to your computer and use it in GitHub Desktop.
Save pirj/586977 to your computer and use it in GitHub Desktop.
def class_for_name name
namespaces = name.split '::'
base = Kernel
namespaces.each do |namespace| base = base.const_get(namespace) end
base
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment