Class: SeriousEats::Recipe
- Inherits:
-
Object
- Object
- SeriousEats::Recipe
- Defined in:
- lib/serious-eats/recipe.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#active_time ⇒ Object
Returns the value of attribute active_time.
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#directions ⇒ Object
Returns the value of attribute directions.
-
#ingredients ⇒ Object
Returns the value of attribute ingredients.
-
#name ⇒ Object
Returns the value of attribute name.
-
#portion ⇒ Object
Returns the value of attribute portion.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#total_time ⇒ Object
Returns the value of attribute total_time.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #has_data? ⇒ Boolean
-
#initialize ⇒ Recipe
constructor
A new instance of Recipe.
Constructor Details
#initialize ⇒ Recipe
Returns a new instance of Recipe.
17 18 19 |
# File 'lib/serious-eats/recipe.rb', line 17 def initialize @@all << self end |
Instance Attribute Details
#active_time ⇒ Object
Returns the value of attribute active_time.
9 10 11 |
# File 'lib/serious-eats/recipe.rb', line 9 def active_time @active_time end |
#category ⇒ Object
Returns the value of attribute category.
5 6 7 |
# File 'lib/serious-eats/recipe.rb', line 5 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/serious-eats/recipe.rb', line 7 def description @description end |
#directions ⇒ Object
Returns the value of attribute directions.
13 14 15 |
# File 'lib/serious-eats/recipe.rb', line 13 def directions @directions end |
#ingredients ⇒ Object
Returns the value of attribute ingredients.
12 13 14 |
# File 'lib/serious-eats/recipe.rb', line 12 def ingredients @ingredients end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/serious-eats/recipe.rb', line 3 def name @name end |
#portion ⇒ Object
Returns the value of attribute portion.
8 9 10 |
# File 'lib/serious-eats/recipe.rb', line 8 def portion @portion end |
#rating ⇒ Object
Returns the value of attribute rating.
11 12 13 |
# File 'lib/serious-eats/recipe.rb', line 11 def @rating end |
#total_time ⇒ Object
Returns the value of attribute total_time.
10 11 12 |
# File 'lib/serious-eats/recipe.rb', line 10 def total_time @total_time end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/serious-eats/recipe.rb', line 4 def url @url end |
Class Method Details
.all ⇒ Object
21 22 23 |
# File 'lib/serious-eats/recipe.rb', line 21 def self.all @@all end |
.find(id) ⇒ Object
25 26 27 |
# File 'lib/serious-eats/recipe.rb', line 25 def self.find(id) self.all[id - 1] end |
Instance Method Details
#has_data? ⇒ Boolean
29 30 31 |
# File 'lib/serious-eats/recipe.rb', line 29 def has_data? !!description end |