Class: Unfuzzle::Comment
- Inherits:
-
Object
- Object
- Unfuzzle::Comment
- Includes:
- Graft
- Defined in:
- lib/unfuzzle/lib/unfuzzle/comment.rb
Class Method Summary collapse
-
.all_by_project_and_ticket(project_id, ticket_id) ⇒ Object
Return a list of all tickets for an individual project.
Instance Method Summary collapse
-
#create(project_id, ticket_id) ⇒ Object
Create a comment.
-
#to_hash ⇒ Object
Hash representation of this ticket’s data (for updating).
Methods included from Graft
Class Method Details
.all_by_project_and_ticket(project_id, ticket_id) ⇒ Object
Return a list of all tickets for an individual project
23 24 25 26 |
# File 'lib/unfuzzle/lib/unfuzzle/comment.rb', line 23 def self.all_by_project_and_ticket(project_id, ticket_id) response = Request.get("/projects/{id}/tickets/{id}/comments") collection_from(response.body, 'comments/comment') end |
Instance Method Details
#create(project_id, ticket_id) ⇒ Object
Create a comment
29 30 31 32 |
# File 'lib/unfuzzle/lib/unfuzzle/comment.rb', line 29 def create(project_id, ticket_id) resource_path = "/projects/#{project_id}/tickets/#{ticket_id}/comments" Request.post(resource_path, self.to_xml('comment')) end |
#to_hash ⇒ Object
Hash representation of this ticket’s data (for updating)
14 15 16 17 18 19 20 |
# File 'lib/unfuzzle/lib/unfuzzle/comment.rb', line 14 def to_hash { 'id' => id, 'body' => body, 'author-id' => } end |