-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.rb
22 lines (19 loc) · 1013 Bytes
/
menu.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require_relative "pizza"
class Menu
attr_accessor :pizzas
def initialize
@pizzas = []
@pizzas << Pizza.new(101, "Verdure", "Homemade grilled vegetables and fresh mushrooms on tomato sauce and mozzarella.", 9)
@pizzas << Pizza.new(102, "Margherita", "Homemade tomato sauce and mozzarella.", 8)
@pizzas << Pizza.new(103, "Tonno", "Tuna and red onions on homemade tomato sauce and mozzarella.", 11)
@pizzas << Pizza.new(104, "Diavolo", "Spicy salsicca sausage, fresh bell pepper and red onions on homemade tomato sauce and mozzarella.", 8)
@pizzas << Pizza.new(105, "Calzone", "Spicy salsicca sausage, Italian ham and fresh mushrooms on homemade tomato sauce and mozzarella.", 9)
@pizzas << Pizza.new(106, "Americana", "Spicy pepperoni salami and tangy salsiccia sausage on homemade tomato sauce with mozzarella.", 9)
end
def print
puts "We have on our menu:"
@pizzas.each do |pizza|
puts "#{pizza.number}: #{pizza.name} - #{pizza.ingredients}"
end
end
end