Class: Project
Constant Summary collapse
- LIMIT =
1000.to_s
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes included from API
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(server, data) ⇒ Project
constructor
A new instance of Project.
- #move_all_repos_to_project(new_project) ⇒ Object
- #repositories ⇒ Object
- #set_hook_status(key, status, settings = nil) ⇒ Object
Methods included from API
#create_api, #parsed_response, #request
Constructor Details
#initialize(server, data) ⇒ Project
Returns a new instance of Project.
12 13 14 15 16 |
# File 'lib/bitbucket/project.rb', line 12 def initialize(server,data) @bb = server @name = data['name'] @key = data['key'] end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
10 11 12 |
# File 'lib/bitbucket/project.rb', line 10 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/bitbucket/project.rb', line 10 def name @name end |
Class Method Details
.get_all(server) ⇒ Object
5 6 7 8 |
# File 'lib/bitbucket/project.rb', line 5 def self.get_all(server) data = server.request(:get, "rest/api/1.0/projects?limit=#{LIMIT}") data['values'].map {|p| new(server,p) } end |
Instance Method Details
#move_all_repos_to_project(new_project) ⇒ Object
22 23 24 25 26 |
# File 'lib/bitbucket/project.rb', line 22 def move_all_repos_to_project(new_project) repositories.each do |r| r.move_repo_to_project(new_project) end end |
#repositories ⇒ Object
18 19 20 |
# File 'lib/bitbucket/project.rb', line 18 def repositories @repositories ||= Repository.get_all(@bb,key) end |
#set_hook_status(key, status, settings = nil) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/bitbucket/project.rb', line 28 def set_hook_status(key,status,settings=nil) repositories.each do |r| r.set_hook_settings(key, settings) if status && settings r.set_hook_status(key, status) end end |