Class: BugherdClient::Resources::Comment
- Defined in:
- lib/bugherd_client/resources/comment.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all(project_id, task_id) ⇒ Object
Get a paginated list of comments for a task.
-
#create(project_id, task_id, attributes = {}) ⇒ Object
Create a comment attributes: text, user_id or email.
Methods inherited from Base
#initialize, #parse_response, #send_request
Constructor Details
This class inherits a constructor from BugherdClient::Resources::Base
Instance Method Details
#all(project_id, task_id) ⇒ Object
Get a paginated list of comments for a task.
8 9 10 11 |
# File 'lib/bugherd_client/resources/comment.rb', line 8 def all(project_id, task_id) raw_response = get_request("projects/#{project_id}/tasks/#{task_id}/comments") parse_response(raw_response, :comments) end |
#create(project_id, task_id, attributes = {}) ⇒ Object
Create a comment attributes: text, user_id or email
16 17 18 19 |
# File 'lib/bugherd_client/resources/comment.rb', line 16 def create(project_id, task_id, attributes={}) raw_response = post_request("projects/#{project_id}/tasks/#{task_id}/comments", comment: attributes) parse_response(raw_response) end |