Skip to content

Instantly share code, notes, and snippets.

@ssoper
Created November 11, 2008 14:47
Show Gist options
  • Save ssoper/23866 to your computer and use it in GitHub Desktop.
Save ssoper/23866 to your computer and use it in GitHub Desktop.
The ghost class! ...spooky
irb(main):001:0> class Foo
irb(main):002:1> def ghost_class
irb(main):003:2> class << self
irb(main):004:3> self
irb(main):005:3> end
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> bar = Foo.new
=> #<Foo:0x871f4>
irb(main):009:0> bar.ghost_class
=> #<Class:#<Foo:0x871f4>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment