Module: Gitlab::Client::Issues
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/issues.rb
Overview
Defines methods related to issues.
Instance Method Summary collapse
-
#close_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Closes an issue.
-
#create_issue(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new issue.
-
#edit_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an issue.
-
#issue(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single issue.
-
#issues(project = nil, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of user’s issues.
-
#reopen_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Reopens an issue.
Instance Method Details
#close_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Closes an issue.
76 77 78 |
# File 'lib/gitlab/client/issues.rb', line 76 def close_issue(project, id) put("/projects/#{project}/issues/#{id}", :body => {:state_event => 'close'}) end |
#create_issue(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new issue.
47 48 49 50 |
# File 'lib/gitlab/client/issues.rb', line 47 def create_issue(project, title, ={}) body = {:title => title}.merge() post("/projects/#{project}/issues", :body => body) end |
#edit_issue(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates an issue.
64 65 66 |
# File 'lib/gitlab/client/issues.rb', line 64 def edit_issue(project, id, ={}) put("/projects/#{project}/issues/#{id}", :body => ) end |
#issue(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single issue.
33 34 35 |
# File 'lib/gitlab/client/issues.rb', line 33 def issue(project, id) get("/projects/#{project}/issues/#{id}") end |
#issues(project = nil, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of user’s issues. Will return a list of project’s issues if project ID passed.
17 18 19 20 21 22 23 |
# File 'lib/gitlab/client/issues.rb', line 17 def issues(project=nil, ={}) if project.to_i.zero? get("/issues", :query => ) else get("/projects/#{project}/issues", :query => ) end end |
#reopen_issue(project, id) ⇒ Gitlab::ObjectifiedHash
Reopens an issue.
88 89 90 |
# File 'lib/gitlab/client/issues.rb', line 88 def reopen_issue(project, id) put("/projects/#{project}/issues/#{id}", :body => {:state_event => 'reopen'}) end |