Class: Posthubify::ReviewsResource
- Inherits:
-
Object
- Object
- Posthubify::ReviewsResource
- Defined in:
- lib/posthubify/resources/messaging.rb
Overview
Review management — list/reply/delete-reply (Node sdk .reviews).
Instance Method Summary collapse
-
#delete_reply(reply_id, account_id) ⇒ Object
Delete a review reply.
-
#initialize(http) ⇒ ReviewsResource
constructor
A new instance of ReviewsResource.
-
#list(platform: nil, account_id: nil, min_rating: nil, max_rating: nil, limit: nil, cursor: nil) ⇒ Object
Review list (paginated envelope + summary).
-
#reply(context_id, input) ⇒ Object
Write a reply to a review.
Constructor Details
#initialize(http) ⇒ ReviewsResource
Returns a new instance of ReviewsResource.
85 86 87 |
# File 'lib/posthubify/resources/messaging.rb', line 85 def initialize(http) @http = http end |
Instance Method Details
#delete_reply(reply_id, account_id) ⇒ Object
Delete a review reply.
98 99 100 |
# File 'lib/posthubify/resources/messaging.rb', line 98 def delete_reply(reply_id, account_id) @http.data('DELETE', "/reviews/replies/#{reply_id}", query: { 'accountId' => account_id }) end |
#list(platform: nil, account_id: nil, min_rating: nil, max_rating: nil, limit: nil, cursor: nil) ⇒ Object
Review list (paginated envelope + summary).
90 91 92 93 94 95 |
# File 'lib/posthubify/resources/messaging.rb', line 90 def list(platform: nil, account_id: nil, min_rating: nil, max_rating: nil, limit: nil, cursor: nil) @http.req('GET', '/reviews', query: { 'platform' => platform, 'accountId' => account_id, 'minRating' => , 'maxRating' => , 'limit' => limit, 'cursor' => cursor }) end |
#reply(context_id, input) ⇒ Object
Write a reply to a review.
103 104 105 |
# File 'lib/posthubify/resources/messaging.rb', line 103 def reply(context_id, input) @http.data('POST', "/reviews/#{context_id}/reply", body: input) end |