Created
September 3, 2009 21:31
-
-
Save Fluxx/180551 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 | |
attr_accessor :bar | |
def set | |
@bar = "set in the set method" | |
end | |
def check | |
p bar | |
bar = "set locally" | |
p bar | |
end | |
end | |
obj = Foo.new | |
obj.set | |
p obj.bar | |
p obj.check | |
__END__ | |
"set in the set method" | |
"set in the set method" | |
"set locally" | |
nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment