Skip to content

Instantly share code, notes, and snippets.

@crispincornett
Created August 8, 2013 18:02
Show Gist options
  • Save crispincornett/6187027 to your computer and use it in GitHub Desktop.
Save crispincornett/6187027 to your computer and use it in GitHub Desktop.
payments.sum(&:price)
payments.inject(0) { |sum, p| sum + p.price }
invoices.map(&:total_due).reduce(0, &:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment