Class: Google::Apis::HealthV4::SleepSummary

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

Sleep summary: metrics and stages summary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ SleepSummary

Returns a new instance of SleepSummary.



5255
5256
5257
# File 'lib/google/apis/health_v4/classes.rb', line 5255

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

Instance Attribute Details

#minutes_after_wake_upFixnum

Output only. Minutes after wake up calculated by restlessness algorithm. Corresponds to the JSON property minutesAfterWakeUp

Returns:

  • (Fixnum)


5225
5226
5227
# File 'lib/google/apis/health_v4/classes.rb', line 5225

def minutes_after_wake_up
  @minutes_after_wake_up
end

#minutes_asleepFixnum

Output only. Total number of minutes asleep. For classic sleep it is the sum of ASLEEP stages (excluding AWAKE and RESTLESS). For "stages" sleep it is the sum of LIGHT, REM and DEEP stages (excluding AWAKE). Corresponds to the JSON property minutesAsleep

Returns:

  • (Fixnum)


5232
5233
5234
# File 'lib/google/apis/health_v4/classes.rb', line 5232

def minutes_asleep
  @minutes_asleep
end

#minutes_awakeFixnum

Output only. Total number of minutes awake. It is a sum of all AWAKE stages. Corresponds to the JSON property minutesAwake

Returns:

  • (Fixnum)


5237
5238
5239
# File 'lib/google/apis/health_v4/classes.rb', line 5237

def minutes_awake
  @minutes_awake
end

#minutes_in_sleep_periodFixnum

Output only. Delta between wake time and bedtime. It is the sum of all stages. Corresponds to the JSON property minutesInSleepPeriod

Returns:

  • (Fixnum)


5242
5243
5244
# File 'lib/google/apis/health_v4/classes.rb', line 5242

def minutes_in_sleep_period
  @minutes_in_sleep_period
end

#minutes_to_fall_asleepFixnum

Output only. Minutes to fall asleep calculated by restlessness algorithm. Corresponds to the JSON property minutesToFallAsleep

Returns:

  • (Fixnum)


5247
5248
5249
# File 'lib/google/apis/health_v4/classes.rb', line 5247

def minutes_to_fall_asleep
  @minutes_to_fall_asleep
end

#stages_summaryArray<Google::Apis::HealthV4::StageSummary>

Output only. List of summaries (total duration and segment count) per each sleep stage type. Corresponds to the JSON property stagesSummary



5253
5254
5255
# File 'lib/google/apis/health_v4/classes.rb', line 5253

def stages_summary
  @stages_summary
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5260
5261
5262
5263
5264
5265
5266
5267
# File 'lib/google/apis/health_v4/classes.rb', line 5260

def update!(**args)
  @minutes_after_wake_up = args[:minutes_after_wake_up] if args.key?(:minutes_after_wake_up)
  @minutes_asleep = args[:minutes_asleep] if args.key?(:minutes_asleep)
  @minutes_awake = args[:minutes_awake] if args.key?(:minutes_awake)
  @minutes_in_sleep_period = args[:minutes_in_sleep_period] if args.key?(:minutes_in_sleep_period)
  @minutes_to_fall_asleep = args[:minutes_to_fall_asleep] if args.key?(:minutes_to_fall_asleep)
  @stages_summary = args[:stages_summary] if args.key?(:stages_summary)
end