Skip to content

Instantly share code, notes, and snippets.

@wbailey
Created December 21, 2010 08:01
Show Gist options
  • Save wbailey/749642 to your computer and use it in GitHub Desktop.
Save wbailey/749642 to your computer and use it in GitHub Desktop.
Exploring the object space of a ruby class
ruby-1.9.2-p0 > a = []; ObjectSpace.each_object(Kata) {|o| a << o.class if o.respond_to? 'gets'}
=> 20576
ruby-1.9.2-p0 > a
=> [IRB::Locale, File, ARGF.class, IO, IO, IO, Module, RubyLex, IO, IO, IRB::ReadlineInputMethod]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment