Class: Fit4Ruby::TrainingStatus

Inherits:
FitDataRecord show all
Defined in:
lib/fit4ruby/TrainingStatus.rb

Overview

This class corresponds to the training_status message.

This is not part of the officially documented FIT API. Names may change in the future if the real Garmin names get known.

Constant Summary

Constants inherited from FitDataRecord

FitDataRecord::RecordOrder

Constants included from BDFieldNameTranslator

BDFieldNameTranslator::BD_DICT

Instance Attribute Summary

Attributes inherited from FitDataRecord

#message, #timestamp

Instance Method Summary collapse

Methods inherited from FitDataRecord

#==, #export, #get, #get_as, #get_unit_by_name, #set, #set_field_values, #write

Methods included from BDFieldNameTranslator

#to_bd_field_name

Methods included from Converters

#conversion_factor, #fit_time_to_time, #secsToDHMS, #secsToHM, #secsToHMS, #speedToPace, #time_to_fit_time

Constructor Details

#initialize(field_values = {}) ⇒ TrainingStatus

Returns a new instance of TrainingStatus.



23
24
25
26
# File 'lib/fit4ruby/TrainingStatus.rb', line 23

def initialize(field_values = {})
  super('training_status')
  set_field_values(field_values)
end

Instance Method Details

#<=>(fdr) ⇒ Object

Ensure that FitDataRecords have a deterministic sequence. Device infos are sorted by device_index.



30
31
32
33
34
35
36
37
# File 'lib/fit4ruby/TrainingStatus.rb', line 30

def <=>(fdr)
  @timestamp == fdr.timestamp ?
    @message.name == fdr.message.name ?
      @device_index <=> fdr.device_index :
      RecordOrder.index(@message.name) <=>
        RecordOrder.index(fdr.message.name) :
    @timestamp <=> fdr.timestamp
end

#check(index) ⇒ Object



39
40
# File 'lib/fit4ruby/TrainingStatus.rb', line 39

def check(index)
end