Class: GitLab::Comment
- Inherits:
-
Object
- Object
- GitLab::Comment
- Defined in:
- lib/GitLab/comment.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#id ⇒ Object
Returns the value of attribute id.
-
#issue_iid ⇒ Object
Returns the value of attribute issue_iid.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(params = {}) ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(params = {}) ⇒ Comment
Returns a new instance of Comment.
4 5 6 7 |
# File 'lib/GitLab/comment.rb', line 4 def initialize(params = {}) @issue_iid = params[:issue_iid] @body = params[:body] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
2 3 4 |
# File 'lib/GitLab/comment.rb', line 2 def body @body end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/GitLab/comment.rb', line 2 def id @id end |
#issue_iid ⇒ Object
Returns the value of attribute issue_iid.
2 3 4 |
# File 'lib/GitLab/comment.rb', line 2 def issue_iid @issue_iid end |
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/GitLab/comment.rb', line 10 def create url = "projects/#{$GITLAB_PROJECT_ID}/issues/#{@issue_iid}/notes" params = { issue_iid: @issue_iid, body: @body } GitLab.request_post(url, params) end |