Class: Yummly::NutritionEstimate

Inherits:
Object
  • Object
show all
Defined in:
lib/yummly/nutrition_estimate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributeObject

Nutrition attribute’s search parameter name.



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

def attribute
  @attribute
end

#descriptionObject

Display name of this nutrition attribute.



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

def description
  @description
end

#unitObject

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



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

def unit
  @unit
end

#valueObject

Nutrition attribute value for this recipe.



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

def value
  @value
end