Slide 15
Slide 15 text
class Recipe
attr_accessor :name, :ingredients, :difficulty
# defines getters and setters
def initialize
@ingredients = []
end
def add_ingredient(ingredient)
ingredients << ingredient
end
def cook!
puts "Cooking #{name} (#{difficulty}),"
puts "with: #{ingredients.join(", ")}."
puts "Buon appetito!"
end
end