Skip to content

Instantly share code, notes, and snippets.

@yxhuvud
Created May 1, 2012 17:46
Show Gist options
  • Save yxhuvud/2569985 to your computer and use it in GitHub Desktop.
Save yxhuvud/2569985 to your computer and use it in GitHub Desktop.
irb(main):001:0> class A
irb(main):002:1> def foo
irb(main):003:2> puts 'foo'
irb(main):004:2> end
irb(main):005:1> def foo= bar
irb(main):006:2> puts 'bar'
irb(main):007:2> end
irb(main):008:1> end
=> nil
irb(main):009:0> x = A.new
=> #<A:0x158dd80>
irb(main):010:0> x.foo = 'hih'
bar
=> "hih"
irb(main):011:0> x.foo &&= 'hih'
foo
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment