Class: Yummly::NutritionEstimate

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#attributeObject

Nutrition attribute’s search parameter name.



7
8
9
# File 'lib/yummly/nutrition_estimate.rb', line 7

def attribute
  @attribute
end

#descriptionObject

Display name of this nutrition attribute.



10
11
12
# File 'lib/yummly/nutrition_estimate.rb', line 10

def description
  @description
end

#unitObject

Implied unit of measure as a Yummly::Unit object.



16
17
18
# File 'lib/yummly/nutrition_estimate.rb', line 16

def unit
  @unit
end

#valueObject

Nutrition attribute value for this recipe.



13
14
15
# File 'lib/yummly/nutrition_estimate.rb', line 13

def value
  @value
end