Class: ActiveNutrition::Objects::NutritionFacts
- Inherits:
-
Array
- Object
- Array
- ActiveNutrition::Objects::NutritionFacts
- Defined in:
- lib/active_nutrition/objects/nutrition_facts.rb
Instance Method Summary collapse
Instance Method Details
#to_hash(options = {}) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/active_nutrition/objects/nutrition_facts.rb', line 6 def to_hash( = {}) [:by] ||= :description inject({}) do |ret, fact| ret[fact.send([:by])] = fact.value ret end end |