Class: GarminConnectrActivitySplit

Inherits:
Object
  • Object
show all
Defined in:
lib/garmin_connectr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ GarminConnectrActivitySplit

Returns a new instance of GarminConnectrActivitySplit.



161
162
163
164
# File 'lib/garmin_connectr.rb', line 161

def initialize( opts={} )
  @index = opts[:index]
  @data = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object (private)



172
173
174
175
176
177
178
# File 'lib/garmin_connectr.rb', line 172

def method_missing(name)
  ## backwards compatibility 
  name = 'avg_temperature' if name.to_s == 'avg_temp'
  
  ret = @data[name.to_sym]
  ret
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



159
160
161
# File 'lib/garmin_connectr.rb', line 159

def data
  @data
end

#indexObject (readonly)

Returns the value of attribute index.



159
160
161
# File 'lib/garmin_connectr.rb', line 159

def index
  @index
end

Instance Method Details

#fieldsObject



166
167
168
# File 'lib/garmin_connectr.rb', line 166

def fields
  @data.keys
end