Module: StravaApi::Clubs

Included in:
Base
Defined in:
lib/strava-api/clubs.rb

Instance Method Summary collapse

Instance Method Details

#club_members(id) ⇒ Object

returns all members, don’t need an offset



22
23
24
25
26
# File 'lib/strava-api/clubs.rb', line 22

def club_members(id)
  result = call("clubs/#{id}/members", "members", {})

  result["members"].collect {|item| Member.new(self, item)}
end

#club_show(id) ⇒ Object



15
16
17
18
19
# File 'lib/strava-api/clubs.rb', line 15

def club_show(id)
  result = call("clubs/#{id}", "club", {})

  Club.new(self, result["club"])
end

#clubs(name) ⇒ Object

returns all clubs, don’t need an offset



4
5
6
7
8
9
10
11
12
13
# File 'lib/strava-api/clubs.rb', line 4

def clubs(name)
  raise StravaApi::CommandError if name.blank?
  
  name = name.strip
  raise StravaApi::CommandError if name.empty?

  result = call("clubs", "clubs", {:name => name})

  result["clubs"].collect {|item| Club.new(self, item)}
end