Class: Strava::LeaderboardEntry
- Inherits:
-
Base
- Object
- Base
- Strava::LeaderboardEntry
show all
- Defined in:
- lib/strava/leaderboard_entry.rb
Instance Attribute Summary collapse
Attributes inherited from Base
#client, #id, #response
Instance Method Summary
collapse
Methods inherited from Base
#detailed?, #initialize, #resource_state, resource_states, #summary?
Constructor Details
This class inherits a constructor from Strava::Base
Instance Attribute Details
#rank ⇒ Object
5
6
7
|
# File 'lib/strava/leaderboard_entry.rb', line 5
def rank
@rank
end
|
Instance Method Details
#activity ⇒ Object
15
16
17
|
# File 'lib/strava/leaderboard_entry.rb', line 15
def activity
@activity ||= Activity.new({'id' => @activity_id}, client: @client)
end
|
#athlete ⇒ Object
11
12
13
|
# File 'lib/strava/leaderboard_entry.rb', line 11
def athlete
@athlete ||= Athlete.new({'id' => @athlete_id}, client: @client)
end
|
#effort ⇒ Object
19
20
21
|
# File 'lib/strava/leaderboard_entry.rb', line 19
def effort
@effort ||= SegmentEffort.new({'id' => @effort_id}, client: @client)
end
|
#set_ivars ⇒ Object
7
8
9
|
# File 'lib/strava/leaderboard_entry.rb', line 7
def set_ivars
@entries = {}
end
|
#update(data, **opts) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/strava/leaderboard_entry.rb', line 23
def update(data, **opts)
@response = data
@athlete_name = data["athlete_name"] @athlete_id = data["athlete_id"] @athlete_gender = data["athlete_gender"] @average_hr = data["average_hr"] @average_watts = data["average_watts"] @distance = data["distance"] @elapsed_time = data["elapsed_time"] @moving_time = data["moving_time"] @start_date = data["start_date"] @start_date_local = data["start_date_local"] @activity_id = data["activity_id"] @effort_id = data["effort_id"] @rank = data["rank"] @athlete_profile = data["athlete_profile"]
end
|