Skip to content

Instantly share code, notes, and snippets.

@budnik
Last active December 15, 2015 17:49
Show Gist options
  • Save budnik/5299510 to your computer and use it in GitHub Desktop.
Save budnik/5299510 to your computer and use it in GitHub Desktop.
class Acme
attr_accessor :a, :b
def initialize
@a=[]
@b=[]
end
def foo!
a<<5
self
end
def bar!
b=[5]
self
end
end
a = Acme.new
a.foo!.bar!
puts a.a, a.b
def foo
Bar||=5
puts 5
end
def bar
puts(a) if (a = 5)
end
def baz
if a = 5
puts a
end
end
def qux
if (a,b = [1,5])
puts a
end
end
foo or bar or baz or qux
@budnik
Copy link
Author

budnik commented Apr 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment