Skip to content

Commit 068d9f0

Browse files
committed
Fix getter method for teams in client.rb
1 parent 0d27aab commit 068d9f0

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

lib/bitbucket_rest_api/client.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def oauth(options = {})
2222
alias :authorizations :oauth
2323

2424
def teams(options = {})
25-
raise "Unimplemented"
26-
#@teams ||= ApiFactory.new 'teams', options
25+
@teams ||= ApiFactory.new 'Teams', options
2726
end
2827

2928
def pull_requests(options = {})

lib/bitbucket_rest_api/teams.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def initialize(options = { })
1313
#
1414
# = Examples
1515
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
16-
# Teams.new.list(:admin)
17-
# Teams.new.list('member')
18-
# Teams.new.list(:contributor) { |team| ... }
16+
# bitbucket.teams.list(:admin)
17+
# bitbucket.teams.list('member')
18+
# bitbucket.teams.list(:contributor) { |team| ... }
1919
def list(user_role)
2020
response = get_request("/2.0/teams/?role=#{user_role.to_s}")
2121
return response["values"] unless block_given?
@@ -28,7 +28,7 @@ def list(user_role)
2828
#
2929
# = Example
3030
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
31-
# Teams.new.profile(:team_name_here)
31+
# bitbucket.teams.profile(:team_name_here)
3232
def profile(team_name)
3333
get_request("/2.0/teams/#{team_name.to_s}")
3434
end
@@ -37,8 +37,8 @@ def profile(team_name)
3737
#
3838
# = Examples
3939
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
40-
# Teams.new.members(:team_name_here)
41-
# Teams.new.members(:team_name_here) { |member| ... }
40+
# bitbucket.teams.members(:team_name_here)
41+
# bitbucket.teams.members(:team_name_here) { |member| ... }
4242
def members(team_name)
4343
response = get_request("/2.0/teams/#{team_name.to_s}/members")
4444
return response["values"] unless block_given?
@@ -49,8 +49,8 @@ def members(team_name)
4949
#
5050
# = Examples
5151
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
52-
# Teams.new.followers(:team_name_here)
53-
# Teams.new.followers(:team_name_here) { |follower| ... }
52+
# bitbucket.teams.followers(:team_name_here)
53+
# bitbucket.teams.followers(:team_name_here) { |follower| ... }
5454
def followers(team_name)
5555
response = get_request("/2.0/teams/#{team_name.to_s}/followers")
5656
return response["values"] unless block_given?
@@ -61,8 +61,8 @@ def followers(team_name)
6161
#
6262
# = Examples
6363
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
64-
# Teams.new.following(:team_name_here)
65-
# Teams.new.following(:team_name_here) { |followee| ... }
64+
# bitbucket.teams.following(:team_name_here)
65+
# bitbucket.teams.following(:team_name_here) { |followee| ... }
6666
def following(team_name)
6767
response = get_request("/2.0/teams/#{team_name.to_s}/following")
6868
return response["values"] unless block_given?
@@ -74,8 +74,8 @@ def following(team_name)
7474
#
7575
# = Examples
7676
# bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
77-
# Teams.new.repos(:team_name_here)
78-
# Teams.new.repos(:team_name_here) { |repo| ... }
77+
# bitbucket.teams.repos(:team_name_here)
78+
# bitbucket.teams.repos(:team_name_here) { |repo| ... }
7979
def repos(team_name)
8080
response = get_request("/2.0/repositories/#{team_name.to_s}")
8181
return response["values"] unless block_given?

0 commit comments

Comments
 (0)