Class: HungryHub::InventoryGenerator
- Inherits:
-
Object
- Object
- HungryHub::InventoryGenerator
- Defined in:
- app/my_lib/hungry_hub/inventory_generator.rb
Instance Attribute Summary collapse
-
#inventory_type ⇒ Object
Returns the value of attribute inventory_type.
-
#random ⇒ Object
Returns the value of attribute random.
-
#remake ⇒ Object
Returns the value of attribute remake.
-
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(restaurant_id = nil) ⇒ InventoryGenerator
constructor
A new instance of InventoryGenerator.
Constructor Details
#initialize(restaurant_id = nil) ⇒ InventoryGenerator
Returns a new instance of InventoryGenerator.
10 11 12 13 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 10 def initialize(restaurant_id = nil) @restaurant_id = restaurant_id self.random = false end |
Instance Attribute Details
#inventory_type ⇒ Object
Returns the value of attribute inventory_type.
8 9 10 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 8 def inventory_type @inventory_type end |
#random ⇒ Object
Returns the value of attribute random.
8 9 10 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 8 def random @random end |
#remake ⇒ Object
Returns the value of attribute remake.
8 9 10 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 8 def remake @remake end |
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
8 9 10 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 8 def restaurant_id @restaurant_id end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 15 def generate if restaurant_id.positive? generate_single else generate_all end end |