Skip to content

Instantly share code, notes, and snippets.

View toreriklinnerud's full-sized avatar

Tor Erik Linnerud toreriklinnerud

  • Decibel
  • New York
View GitHub Profile
# Needs Ruby 1.8.7+ for built in #group_by and #reduce
# Implementation
Product = Struct.new(:code, :name, :price) do
def line_total(quantity)
price * quantity
end
end