Skip to content

Instantly share code, notes, and snippets.

@Fluxx
Created September 3, 2009 21:31
Show Gist options
  • Save Fluxx/180551 to your computer and use it in GitHub Desktop.
Save Fluxx/180551 to your computer and use it in GitHub Desktop.
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