Class: Google::Apis::HealthV4::Serving

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) ⇒ Serving

Returns a new instance of Serving.



4965
4966
4967
# File 'lib/google/apis/health_v4/classes.rb', line 4965

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

Instance Attribute Details

#amountFloat

Optional. The number of servings. Corresponds to the JSON property amount

Returns:

  • (Float)


4952
4953
4954
# File 'lib/google/apis/health_v4/classes.rb', line 4952

def amount
  @amount
end

#food_measurement_unitString

Required. Food measurement unit Corresponds to the JSON property foodMeasurementUnit

Returns:

  • (String)


4957
4958
4959
# File 'lib/google/apis/health_v4/classes.rb', line 4957

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)


4963
4964
4965
# File 'lib/google/apis/health_v4/classes.rb', line 4963

def food_measurement_unit_display_name
  @food_measurement_unit_display_name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4970
4971
4972
4973
4974
# File 'lib/google/apis/health_v4/classes.rb', line 4970

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