Skip to content

Instantly share code, notes, and snippets.

@dbussink
Created July 5, 2011 19:05
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 dbussink/e0992719d4ee7ff32bec to your computer and use it in GitHub Desktop.
Save dbussink/e0992719d4ee7ff32bec to your computer and use it in GitHub Desktop.
module ObjectSpace
class << self
# Returns all the classes in the object space.
def classes
ObjectSpace.each_object(Module).select do |klass|
Class.class_eval { klass } rescue false
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment