Class: Yummly::NutritionEstimate
- Inherits:
-
Object
- Object
- Yummly::NutritionEstimate
- Defined in:
- lib/yummly/nutrition_estimate.rb
Overview
The nutritional composition of the recipe, in the form of a list of nutrients and their amounts, per serving. Yummly will return nutrition estimates only for those recipes where we are reasonably confident in their accuracy. These are only estimates and you should be clear about that in what you tell your users.
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.
18 19 20 21 22 23 |
# File 'lib/yummly/nutrition_estimate.rb', line 18 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.
7 8 9 |
# File 'lib/yummly/nutrition_estimate.rb', line 7 def attribute @attribute end |
#description ⇒ Object
Display name of this nutrition attribute.
10 11 12 |
# File 'lib/yummly/nutrition_estimate.rb', line 10 def description @description end |
#unit ⇒ Object
Implied unit of measure as a Yummly::Unit object.
16 17 18 |
# File 'lib/yummly/nutrition_estimate.rb', line 16 def unit @unit end |
#value ⇒ Object
Nutrition attribute value for this recipe.
13 14 15 |
# File 'lib/yummly/nutrition_estimate.rb', line 13 def value @value end |