Sha256: 437555594a5abb29db843aa1e8ed5f0de70c0ddc0aa29ec225b44a20d689b07f
Contents?: true
Size: 283 Bytes
Versions: 305
Compression:
Stored size: 283 Bytes
Contents
class Pantry def initialize @items = {} end def add(food_name, count) @items[food_name] ||= 0 @items[food_name] += count.to_i end def remove(food_name, count) @items[food_name] -= count.to_i end def count(food_name) @items[food_name] end end
Version data entries
305 entries across 301 versions & 27 rubygems