Created
March 23, 2011 09:58
-
-
Save ngw/882879 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
>> class Foo | |
>> def initialize arg | |
>> @attr = arg | |
>> end | |
>> attr_accessor :attr | |
>> def attr=( arg ) | |
>> puts 'HA!' | |
>> end | |
>> end | |
>> Foo.new 'test' | |
=> #<Foo:0x1012f55d8 @attr="test"> | |
>> class Foo | |
>> def initialize arg | |
>> self.attr = arg | |
>> end | |
>> end | |
=> nil | |
>> Foo.new 'test' | |
HA! | |
=> #<Foo:0x1012d9270> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment