ObjectSpace in Ruby
If you want to gather information about a bunch of objects in Ruby, you can iterate through them and ask. For example, to find all classes that have Enumerable mixed in you can do this:
ObjectSpace.each_object(Class).select { |e| e.ancestors.include?(Enumerable) }"
Written by Kevin Curtin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#