Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- end
- Foo.object_id # => 34581480
- f = Foo.new # => #<Foo:0x000000041f53c0>
- f.class.object_id # => 34581480
- # This just prevents the "const redefined" warning
- Object.send(:remove_const, :Foo)
- # "Reload" class Foo
- class Foo
- end
- Foo.object_id # => 34580180
- f.class.object_id # => 34581480
- f.is_a?(Foo) # => false
- f.class == Foo # => false
- f.class.name == "Foo" # => true
Add Comment
Please, Sign In to add comment