Class: Strava::Gear
Overview
Gear represents both shoes and bikes. These are returned as part of the athlete summary.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_details ⇒ Hash
Retrieve full details for Gear object.
-
#update(data, **opts) ⇒ self
Updates gear with passed data attributes.
Methods inherited from Base
#detailed?, #initialize, #resource_state, resource_states, #summary?
Constructor Details
This class inherits a constructor from Strava::Base
Instance Method Details
#get_details ⇒ Hash
Retrieve full details for Gear object. Sets all data attributes on self.
23 24 25 26 27 28 |
# File 'lib/strava/gear.rb', line 23 def get_details return self if detailed? res = client.get(path_base).to_h update(res) res end |
#update(data, **opts) ⇒ self
Updates gear with passed data attributes.
12 13 14 15 16 17 |
# File 'lib/strava/gear.rb', line 12 def update(data, **opts) @response = data @id = data['id'] @resource_state = data['resource_state'] self end |