Class: Google::Apis::HealthV4::Serving
- Inherits:
-
Object
- Object
- Google::Apis::HealthV4::Serving
- 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.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Serving
constructor
A new instance of Serving.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Serving
Returns a new instance of Serving.
4757 4758 4759 |
# File 'lib/google/apis/health_v4/classes.rb', line 4757 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
4744 4745 4746 |
# File 'lib/google/apis/health_v4/classes.rb', line 4744 def amount @amount end |
#food_measurement_unit ⇒ String
Required. Food measurement unit
Corresponds to the JSON property foodMeasurementUnit
4749 4750 4751 |
# File 'lib/google/apis/health_v4/classes.rb', line 4749 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
4755 4756 4757 |
# File 'lib/google/apis/health_v4/classes.rb', line 4755 def food_measurement_unit_display_name @food_measurement_unit_display_name end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4762 4763 4764 4765 4766 |
# File 'lib/google/apis/health_v4/classes.rb', line 4762 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) end |