Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- @cvar = "foo"
- def foo
- @cvar
- end
- def foo=(val)
- @cvar = val
- end
- end
- a = Foo.new
- b = Foo.new
- puts "This is @cvar for a:" + a.foo
- puts "This is @cvar for b:" + b.foo
- a.foo = "baz"
- puts "This is @cvar for a:" + a.foo
- puts "This is @cvar for b:" + b.foo
Add Comment
Please, Sign In to add comment