class Nutriscore::UK::GeneralScore
Attributes
negative[R]
positive[R]
Public Class Methods
new(nutrients, fibres_method: :aoac)
click to toggle source
# File lib/nutriscore/uk/general_score.rb, line 17 def initialize(nutrients, fibres_method: :aoac) @nutrients = Nutriscore::Common::Nutrients.wrap(nutrients) @positive = PositiveScore.new(@nutrients, fibres_method: fibres_method) @negative = NegativeScore.new(@nutrients) end
nutrient_keys()
click to toggle source
# File lib/nutriscore/uk/general_score.rb, line 13 def self.nutrient_keys PositiveScore.nutrient_keys | NegativeScore.nutrient_keys end
Public Instance Methods
inspect()
click to toggle source
# File lib/nutriscore/uk/general_score.rb, line 27 def inspect "#<#{self.class} score=#{score} " + "positive_score=#{@positive.inspect} negative_score=#{@negative.inspect}>" end
score()
click to toggle source
# File lib/nutriscore/uk/general_score.rb, line 23 def score @negative.score - @positive.score end