Class: ActiveNutrition::Models::NutData
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ActiveNutrition::Models::NutData
- Defined in:
- lib/active_nutrition/models/nut_data.rb
Instance Method Summary collapse
-
#amount_per_gram ⇒ Object
the value of Nutr_Val is the number of grams in 100 grams total, which it makes it easy to calculate the amount in every 1 gram.
Instance Method Details
#amount_per_gram ⇒ Object
the value of Nutr_Val is the number of grams in 100 grams total, which it makes it easy to calculate the amount in every 1 gram
17 18 19 |
# File 'lib/active_nutrition/models/nut_data.rb', line 17 def amount_per_gram return self.Nutr_Val.to_f / 100.0 end |