Class: Basecamp::Services::CommentsService
- Inherits:
-
BaseService
- Object
- BaseService
- Basecamp::Services::CommentsService
- Defined in:
- lib/basecamp/generated/services/comments_service.rb
Overview
Service for Comments operations
Instance Method Summary collapse
-
#create(recording_id:, content:) ⇒ Hash
Create a new comment on a recording.
-
#get(comment_id:) ⇒ Hash
Get a single comment by id.
-
#list(recording_id:) ⇒ Enumerator<Hash>
List comments on a recording.
-
#update(comment_id:, content:) ⇒ Hash
Update an existing comment.
Constructor Details
This class inherits a constructor from Basecamp::Services::BaseService
Instance Method Details
#create(recording_id:, content:) ⇒ Hash
Create a new comment on a recording
42 43 44 45 46 |
# File 'lib/basecamp/generated/services/comments_service.rb', line 42 def create(recording_id:, content:) with_operation(service: "comments", operation: "create", is_mutation: true, resource_id: recording_id) do http_post("/recordings/#{recording_id}/comments.json", body: compact_params(content: content)).json end end |
#get(comment_id:) ⇒ Hash
Get a single comment by id
13 14 15 16 17 |
# File 'lib/basecamp/generated/services/comments_service.rb', line 13 def get(comment_id:) with_operation(service: "comments", operation: "get", is_mutation: false, resource_id: comment_id) do http_get("/comments/#{comment_id}").json end end |
#list(recording_id:) ⇒ Enumerator<Hash>
List comments on a recording
32 33 34 35 36 |
# File 'lib/basecamp/generated/services/comments_service.rb', line 32 def list(recording_id:) wrap_paginated(service: "comments", operation: "list", is_mutation: false, resource_id: recording_id) do paginate("/recordings/#{recording_id}/comments.json") end end |
#update(comment_id:, content:) ⇒ Hash
Update an existing comment
23 24 25 26 27 |
# File 'lib/basecamp/generated/services/comments_service.rb', line 23 def update(comment_id:, content:) with_operation(service: "comments", operation: "update", is_mutation: true, resource_id: comment_id) do http_put("/comments/#{comment_id}", body: compact_params(content: content)).json end end |