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