Class: HungryHub::InventoryGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/my_lib/hungry_hub/inventory_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typeObject

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

#randomObject

Returns the value of attribute random.



8
9
10
# File 'app/my_lib/hungry_hub/inventory_generator.rb', line 8

def random
  @random
end

#remakeObject

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_idObject

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

#generateObject



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