Skip to content

Instantly share code, notes, and snippets.

@peashutop
Last active December 26, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peashutop/7177597 to your computer and use it in GitHub Desktop.
Save peashutop/7177597 to your computer and use it in GitHub Desktop.
without inject, too much ceremony
def total_pony_count
total_ponies = 0
farms.each do |farm|
total_ponies += farm.pony_count
end
total_ponies
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment