Skip to content

Instantly share code, notes, and snippets.

@yakjuly
Forked from hooopo/each_object
Created August 9, 2012 10:10
Show Gist options
  • Save yakjuly/3302944 to your computer and use it in GitHub Desktop.
Save yakjuly/3302944 to your computer and use it in GitHub Desktop.
each_object
[8] pry(main)> class A;;end
=> nil
[9] pry(main)> a1 = A.new
=> #<A:0xab50838>
[10] pry(main)> a2 = A.new
=> #<A:0xa8871b0>
[11] pry(main)> ObjectSpace.each_object(A){|object| p object}
#<A:0xa8871b0>
#<A:0xab50838>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment