Class: Google::Apis::HealthV4::FoodServing

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/health_v4/classes.rb,
lib/google/apis/health_v4/representations.rb,
lib/google/apis/health_v4/representations.rb

Overview

Represents different properties and information about the serving of a specific food.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FoodServing

Returns a new instance of FoodServing.



2582
2583
2584
# File 'lib/google/apis/health_v4/classes.rb', line 2582

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#amountFloat

Optional. Amount of food consumed, fractional values are supported. Corresponds to the JSON property amount

Returns:

  • (Float)


2557
2558
2559
# File 'lib/google/apis/health_v4/classes.rb', line 2557

def amount
  @amount
end

#food_measurement_unitString

Required. Food measurement unit Corresponds to the JSON property foodMeasurementUnit

Returns:

  • (String)


2562
2563
2564
# File 'lib/google/apis/health_v4/classes.rb', line 2562

def food_measurement_unit
  @food_measurement_unit
end

#food_measurement_unit_display_nameString

Output only. Legacy measurement unit for serving size in singular form (e.g. " piece", "gram"). Corresponds to the JSON property foodMeasurementUnitDisplayName

Returns:

  • (String)


2568
2569
2570
# File 'lib/google/apis/health_v4/classes.rb', line 2568

def food_measurement_unit_display_name
  @food_measurement_unit_display_name
end

#food_measurement_unit_display_name_pluralString

Output only. Legacy measurement unit for serving size in plural form (e.g. " pieces", "grams"). Corresponds to the JSON property foodMeasurementUnitDisplayNamePlural

Returns:

  • (String)


2574
2575
2576
# File 'lib/google/apis/health_v4/classes.rb', line 2574

def food_measurement_unit_display_name_plural
  @food_measurement_unit_display_name_plural
end

#multiplierFloat

Optional. Value representing the multiplier used to compute the energy when using this serving instead of the default serving. Corresponds to the JSON property multiplier

Returns:

  • (Float)


2580
2581
2582
# File 'lib/google/apis/health_v4/classes.rb', line 2580

def multiplier
  @multiplier
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2587
2588
2589
2590
2591
2592
2593
# File 'lib/google/apis/health_v4/classes.rb', line 2587

def update!(**args)
  @amount = args[:amount] if args.key?(:amount)
  @food_measurement_unit = args[:food_measurement_unit] if args.key?(:food_measurement_unit)
  @food_measurement_unit_display_name = args[:food_measurement_unit_display_name] if args.key?(:food_measurement_unit_display_name)
  @food_measurement_unit_display_name_plural = args[:food_measurement_unit_display_name_plural] if args.key?(:food_measurement_unit_display_name_plural)
  @multiplier = args[:multiplier] if args.key?(:multiplier)
end