Class: System::Inventory
- Inherits:
-
Object
- Object
- System::Inventory
- Includes:
- Singleton
- Defined in:
- lib/inventory/inventory.rb
Class Method Summary collapse
- .add(amount, item) ⇒ Object
- .add_all(bag) ⇒ Object
- .has?(amount, item) ⇒ Boolean
- .print ⇒ Object
- .remove(amount, item) ⇒ Object
- .remove_all(bag) ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Inventory
constructor
A new instance of Inventory.
Constructor Details
Class Method Details
.add(amount, item) ⇒ Object
14 15 16 |
# File 'lib/inventory/inventory.rb', line 14 def self.add(amount, item) @bag.add(amount, item) end |
.add_all(bag) ⇒ Object
18 19 20 |
# File 'lib/inventory/inventory.rb', line 18 def self.add_all(bag) @bag.add_all(bag) end |
.has?(amount, item) ⇒ Boolean
30 31 32 |
# File 'lib/inventory/inventory.rb', line 30 def self.has?(amount, item) @bag.has?(amount, item) end |
.print ⇒ Object
34 35 36 |
# File 'lib/inventory/inventory.rb', line 34 def self.print @bag.print end |
.remove(amount, item) ⇒ Object
26 27 28 |
# File 'lib/inventory/inventory.rb', line 26 def self.remove(amount, item) @bag.remove(amount, item) end |
.remove_all(bag) ⇒ Object
22 23 24 |
# File 'lib/inventory/inventory.rb', line 22 def self.remove_all(bag) @bag.remove_all(bag) end |