-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
club_event.rb
30 lines (28 loc) · 997 Bytes
/
club_event.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
module Strava
module Models
class ClubEvent < Strava::Models::Response
property 'id'
property 'resource_state'
property 'title'
property 'club_id'
property 'club', transform_with: ->(c) { Strava::Models::Club.new(c) }
property 'organizing_athlete', transform_with: ->(oa) { Strava::Models::Athlete.new(oa) }
property 'activity_type'
property 'created_at', transform_with: ->(v) { Time.parse(v) }
property 'route_id'
property 'route', transform_with: ->(r) { Strava::Models::Route.new(r) }
property 'women_only'
property 'private'
property 'skill_levels'
property 'terrain'
property 'upcoming_occurrences', transform_with: ->(upcoming) { upcoming.map { |o| Time.parse(o) } }
property 'zone'
property 'address'
property 'start_latlng'
def strava_url
"https://www.strava.com/clubs/#{club_id}/group_events/#{id}"
end
end
end
end