Created
November 9, 2009 20:06
-
-
Save mattetti/230240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb1.9 | |
irb(main):001:0> class Foo; end | |
=> nil | |
irb(main):002:0> foo = Foo.new | |
=> #<Foo:0x0000010107cd38> | |
irb(main):003:0> def foo.bar; 'foobar'; end | |
=> nil | |
irb(main):004:0> foo.bar | |
=> "foobar" | |
irb(main):005:0> Foo.new.bar | |
NoMethodError: undefined method `bar' for #<Foo:0x00000101071ca8> | |
from (irb):5 | |
from /usr/local/bin/irb1.9:12:in `<main>' | |
irb(main):006:0> foo.singleton_methods | |
=> [:bar] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment