class TodaysTopDesserts::Recipe
Attributes
calorie_count[RW]
cook_time[RW]
description[RW]
ingredients[RW]
instructions[RW]
name[RW]
prep_time[RW]
ready_time[RW]
serving_size[RW]
url[RW]
Public Class Methods
create_from_collection(recipes_array)
click to toggle source
# File lib/todays_top_desserts/recipe.rb, line 12 def self.create_from_collection(recipes_array) #creates new recipes from an array of hashes that include recipe attributes recipes_array.each do |hash| TodaysTopDesserts::Recipe.new(hash) end end
new(recipe_hash)
click to toggle source
# File lib/todays_top_desserts/recipe.rb, line 6 def initialize(recipe_hash) #initializes new recipe with a hash of attributes recipe_hash.each {|key, value| self.send(("#{key}="), value)} @@all << self end
today()
click to toggle source
# File lib/todays_top_desserts/recipe.rb, line 25 def self.today #returns all instances of TodaysTopDesserts::Recipe @@all end
Public Instance Methods
add_recipe_attributes(attributes_hash)
click to toggle source
# File lib/todays_top_desserts/recipe.rb, line 19 def add_recipe_attributes(attributes_hash) #adds attributes to existing recipes attributes_hash.each {|key, value| self.send(("#{key}="), value)} self end