Class: Google::Apis::HealthV4::FoodServing
- Inherits:
-
Object
- Object
- Google::Apis::HealthV4::FoodServing
- 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
-
#amount ⇒ Float
Optional.
-
#food_measurement_unit ⇒ String
Required.
-
#food_measurement_unit_display_name ⇒ String
Output only.
-
#food_measurement_unit_display_name_plural ⇒ String
Output only.
-
#multiplier ⇒ Float
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ FoodServing
constructor
A new instance of FoodServing.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ FoodServing
Returns a new instance of FoodServing.
2546 2547 2548 |
# File 'lib/google/apis/health_v4/classes.rb', line 2546 def initialize(**args) update!(**args) end |
Instance Attribute Details
#amount ⇒ Float
Optional. Amount of food consumed, fractional values are supported.
Corresponds to the JSON property amount
2521 2522 2523 |
# File 'lib/google/apis/health_v4/classes.rb', line 2521 def amount @amount end |
#food_measurement_unit ⇒ String
Required. Food measurement unit
Corresponds to the JSON property foodMeasurementUnit
2526 2527 2528 |
# File 'lib/google/apis/health_v4/classes.rb', line 2526 def food_measurement_unit @food_measurement_unit end |
#food_measurement_unit_display_name ⇒ String
Output only. Legacy measurement unit for serving size in singular form (e.g. "
piece", "gram").
Corresponds to the JSON property foodMeasurementUnitDisplayName
2532 2533 2534 |
# File 'lib/google/apis/health_v4/classes.rb', line 2532 def food_measurement_unit_display_name @food_measurement_unit_display_name end |
#food_measurement_unit_display_name_plural ⇒ String
Output only. Legacy measurement unit for serving size in plural form (e.g. "
pieces", "grams").
Corresponds to the JSON property foodMeasurementUnitDisplayNamePlural
2538 2539 2540 |
# File 'lib/google/apis/health_v4/classes.rb', line 2538 def food_measurement_unit_display_name_plural @food_measurement_unit_display_name_plural end |
#multiplier ⇒ Float
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
2544 2545 2546 |
# File 'lib/google/apis/health_v4/classes.rb', line 2544 def multiplier @multiplier end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2551 2552 2553 2554 2555 2556 2557 |
# File 'lib/google/apis/health_v4/classes.rb', line 2551 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 |