class Mindee::Product::NutritionFactsLabel::NutritionFactsLabelV1SaturatedFat

The amount of saturated fat in the product.

def initialize(prediction, page_id)

Parameters:
  • page_id (Integer, nil) --
  • prediction (Hash) --
def initialize(prediction, page_id)
  super
  @daily_value = prediction['daily_value']
  @per_100g = prediction['per_100g']
  @per_serving = prediction['per_serving']
  @page_id = page_id
end

def printable_values

Returns:
  • (Hash) -
def printable_values
  printable = {}
  printable[:daily_value] =
    @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value)
  printable[:per_100g] =
    @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g)
  printable[:per_serving] =
    @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving)
  printable
end

def to_s

Returns:
  • (String) -
def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Daily Value: #{printable[:daily_value]}"
  out_str << "\n  :Per 100g: #{printable[:per_100g]}"
  out_str << "\n  :Per Serving: #{printable[:per_serving]}"
  out_str
end