Module: Strava::Api::Endpoints::Clubs

Included in:
Client
Defined in:
lib/strava/api/endpoints/clubs.rb

Instance Method Summary collapse

Instance Method Details

#athlete_clubs(options = {}, &block) ⇒ Object

List logged-in athlete clubs.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



86
87
88
# File 'lib/strava/api/endpoints/clubs.rb', line 86

def athlete_clubs(options = {}, &block)
  paginate 'athlete/clubs', options, Strava::Models::Club, &block
end

#club(id_or_options, options = {}) ⇒ Object

Get club.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Club id.



58
59
60
61
# File 'lib/strava/api/endpoints/clubs.rb', line 58

def club(id_or_options, options = {})
  id, options = parse_args(id_or_options, options)
  Strava::Models::Club.new(get("clubs/#{id}", options))
end

#club_activities(id_or_options, options = {}, &block) ⇒ Object

List club activities.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Club id.

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



17
18
19
20
# File 'lib/strava/api/endpoints/clubs.rb', line 17

def club_activities(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "clubs/#{id}/activities", options, Strava::Models::Activity, &block
end

#club_admins(id_or_options, options = {}, &block) ⇒ Object

List club administrators.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Club id.

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



47
48
49
50
# File 'lib/strava/api/endpoints/clubs.rb', line 47

def club_admins(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "clubs/#{id}/admins", options, Strava::Models::ClubAdmin, &block
end

#club_events(id_or_options, options = {}, &block) ⇒ Object

List club / group events.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Club id.

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



32
33
34
35
# File 'lib/strava/api/endpoints/clubs.rb', line 32

def club_events(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "clubs/#{id}/group_events", options, Strava::Models::ClubEvent, &block
end

#club_members(id_or_options, options = {}, &block) ⇒ Object

List club members.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :id (String)

    Club id.

  • :page (Integer)

    Page number.

  • :per_page (Integer)

    Number of items per page. Defaults to 30.



73
74
75
76
# File 'lib/strava/api/endpoints/clubs.rb', line 73

def club_members(id_or_options, options = {}, &block)
  id, options = parse_args(id_or_options, options)
  paginate "clubs/#{id}/members", options, Strava::Models::ClubMember, &block
end