Class: Stash::Repository
- Inherits:
-
Object
- Object
- Stash::Repository
- Defined in:
- lib/stash/repository.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#server ⇒ Object
Returns the value of attribute server.
Instance Method Summary collapse
- #endpoint ⇒ Object
- #get(path) ⇒ Object
-
#initialize(server, project, repo) ⇒ Repository
constructor
A new instance of Repository.
- #logger ⇒ Object
- #post(path, data) ⇒ Object
- #pull_request(id) ⇒ Object
Constructor Details
#initialize(server, project, repo) ⇒ Repository
Returns a new instance of Repository.
7 8 9 10 11 |
# File 'lib/stash/repository.rb', line 7 def initialize(server, project, repo) self.server = server self.project = project self.repo = repo end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
5 6 7 |
# File 'lib/stash/repository.rb', line 5 def project @project end |
#repo ⇒ Object
Returns the value of attribute repo.
5 6 7 |
# File 'lib/stash/repository.rb', line 5 def repo @repo end |
#server ⇒ Object
Returns the value of attribute server.
5 6 7 |
# File 'lib/stash/repository.rb', line 5 def server @server end |
Instance Method Details
#endpoint ⇒ Object
25 26 27 |
# File 'lib/stash/repository.rb', line 25 def endpoint "/projects/#{project}/repos/#{repo}" end |
#get(path) ⇒ Object
17 18 19 |
# File 'lib/stash/repository.rb', line 17 def get(path) server.get(endpoint + path) end |
#logger ⇒ Object
29 30 31 |
# File 'lib/stash/repository.rb', line 29 def logger server.logger end |
#post(path, data) ⇒ Object
21 22 23 |
# File 'lib/stash/repository.rb', line 21 def post(path, data) server.post(endpoint + path, data) end |
#pull_request(id) ⇒ Object
13 14 15 |
# File 'lib/stash/repository.rb', line 13 def pull_request(id) PullRequest.new(self, id) end |