Skip to content

Instantly share code, notes, and snippets.

@bigtiger
Created December 9, 2009 16:09
Show Gist options
  • Save bigtiger/252563 to your computer and use it in GitHub Desktop.
Save bigtiger/252563 to your computer and use it in GitHub Desktop.
class A
def goal
1
end
end
a = A.new
[a, a, a].sum(&:goal) #=> 3
class B
def goal
2
end
end
b = B.new
[b, b, b].sum(&:goal) #=> 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment