Class: TopRecipes::Recipe
- Inherits:
-
Object
- Object
- TopRecipes::Recipe
- Defined in:
- lib/top_recipes/recipe.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#directions ⇒ Object
Returns the value of attribute directions.
-
#ingredients ⇒ Object
Returns the value of attribute ingredients.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ Recipe
constructor
A new instance of Recipe.
Constructor Details
#initialize(name) ⇒ Recipe
Returns a new instance of Recipe.
8 9 10 11 |
# File 'lib/top_recipes/recipe.rb', line 8 def initialize(name) @name = name @@all << self end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
3 4 5 |
# File 'lib/top_recipes/recipe.rb', line 3 def @author end |
#directions ⇒ Object
Returns the value of attribute directions.
3 4 5 |
# File 'lib/top_recipes/recipe.rb', line 3 def directions @directions end |
#ingredients ⇒ Object
Returns the value of attribute ingredients.
3 4 5 |
# File 'lib/top_recipes/recipe.rb', line 3 def ingredients @ingredients end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/top_recipes/recipe.rb', line 4 def name @name end |
#rating ⇒ Object
Returns the value of attribute rating.
3 4 5 |
# File 'lib/top_recipes/recipe.rb', line 3 def @rating end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/top_recipes/recipe.rb', line 3 def url @url end |
Class Method Details
.top_recipes ⇒ Object
13 14 15 |
# File 'lib/top_recipes/recipe.rb', line 13 def self.top_recipes @@all end |