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

Version Path
aslakhellesoy-cucumber-0.1.99.5 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.1.99.6 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.1.99.7 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.1.99.8 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.1.99.9 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.0.1 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.0.2 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.0.3 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.0.4 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.0 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.1 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.2.1 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.2.2 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.2 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.3.1 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.3.2 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.3.3 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.3.4 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.2.3 examples/tickets/features/lib/pantry.rb
aslakhellesoy-cucumber-0.3.0.1 examples/tickets/features/lib/pantry.rb