Skip to content

Instantly share code, notes, and snippets.

@Mon-Ouie
Created May 7, 2013 07:12
Show Gist options
  • Save Mon-Ouie/5530767 to your computer and use it in GitHub Desktop.
Save Mon-Ouie/5530767 to your computer and use it in GitHub Desktop.
class Foo
def initialize(n)
@n = n
end
attr_reader :n
def abracadabra_alakazam(x)
Foo.new(n + x.n)
end
end
[Foo.new(1), Foo.new(2), Foo.new(3)].inject :abracadabra_alakazam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment