-
Notifications
You must be signed in to change notification settings - Fork 36
HowToUse
hirakiuc edited this page Jul 15, 2017
·
9 revisions
The first step to use tinybucket
gem.
At first, you must configure oauth_token/oauth_secret and create Tinybucket::Client instance.
bucket = Tinybucket.new do |config|
config.oauth_key = 'Your OAuth Token'
config.oauth_secret = 'Your OAuth Secret'
end
# get Repository model.
repo = bucket.repo('owner', 'slug')
# just call `load` method if you need more attributes
repo.load
[How to use Repository](HowToUse Repository)
# get Repository model.
team = bucket.team('team_name')
# just call `load` method if you need more attributes
team.load
role = 'admin'
teams = bucket.teams(role)
teams.each do |team|
puts team.username
end
=> Check the bitbucket document about role
.
[How to use Team](HowToUse Team)
# get Repository model.
user = bucket.user('user_name')
# just call `load` method if you need more attributes
user.load
[How to use User](HowToUse User)