Class: Yummly::NutritionEstimate
- Inherits:
-
Object
- Object
- Yummly::NutritionEstimate
- Defined in:
- lib/yummly/nutrition_estimate.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Nutrition attribute’s search parameter name.
-
#description ⇒ Object
Display name of this nutrition attribute.
-
#unit ⇒ Object
Implied unit of measure as a Yummly::Unit object.
-
#value ⇒ Object
Nutrition attribute value for this recipe.
Instance Method Summary collapse
-
#initialize(values) ⇒ NutritionEstimate
constructor
A new instance of NutritionEstimate.
Constructor Details
#initialize(values) ⇒ NutritionEstimate
Returns a new instance of NutritionEstimate.
19 20 21 22 23 24 |
# File 'lib/yummly/nutrition_estimate.rb', line 19 def initialize(values) @attribute = values["attribute"] @description = values["description"] @value = values["value"] @unit = Yummly::Unit.new(values["unit"]) end |
Instance Attribute Details
#attribute ⇒ Object
Nutrition attribute’s search parameter name.
8 9 10 |
# File 'lib/yummly/nutrition_estimate.rb', line 8 def attribute @attribute end |
#description ⇒ Object
Display name of this nutrition attribute.
11 12 13 |
# File 'lib/yummly/nutrition_estimate.rb', line 11 def description @description end |
#unit ⇒ Object
Implied unit of measure as a Yummly::Unit object.
17 18 19 |
# File 'lib/yummly/nutrition_estimate.rb', line 17 def unit @unit end |
#value ⇒ Object
Nutrition attribute value for this recipe.
14 15 16 |
# File 'lib/yummly/nutrition_estimate.rb', line 14 def value @value end |