Class: Nutriscore::FR::FatsScore
Overview
this is for vegetable and animal fats and oils
Instance Attribute Summary
#nutrients
Class Method Summary
collapse
Instance Method Summary
collapse
#score_class
#initialize, #inspect
Class Method Details
.nutrient_keys ⇒ Object
10
11
12
|
# File 'lib/nutriscore/fr/fats_score.rb', line 10
def self.nutrient_keys
[:fat_saturated, :fat_total]
end
|
Instance Method Details
#fat_saturated ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/nutriscore/fr/fats_score.rb', line 18
def fat_saturated
score_value(fat_saturated_pct, 0..10) do |v|
if v < 10 then 0
elsif v < 16 then 1
elsif v < 22 then 2
elsif v < 28 then 3
elsif v < 34 then 4
elsif v < 40 then 5
elsif v < 46 then 6
elsif v < 52 then 7
elsif v < 58 then 8
elsif v < 64 then 9
else 10
end
end
end
|
#score ⇒ Object
14
15
16
|
# File 'lib/nutriscore/fr/fats_score.rb', line 14
def score
fat_saturated
end
|