Class: Dogapi::V1::CommentService
- Inherits:
-
APIService
- Object
- APIService
- Dogapi::V1::CommentService
- Defined in:
- lib/dogapi/v1/comment.rb
Constant Summary collapse
- API_VERSION =
'v1'
Instance Attribute Summary
Attributes inherited from APIService
Instance Method Summary collapse
-
#comment(message, options = {}) ⇒ Object
Submit a comment.
- #delete_comment(comment_id) ⇒ Object
-
#update_comment(comment_id, options = {}) ⇒ Object
Update a comment.
Methods inherited from APIService
#connect, #handle_redirect, #handle_response, #initialize, #prepare_params, #prepare_request, #request, #should_set_api_and_app_keys_in_params?, #suppress_error_if_silent
Constructor Details
This class inherits a constructor from Dogapi::APIService
Instance Method Details
#comment(message, options = {}) ⇒ Object
Submit a comment.
13 14 15 16 17 18 19 |
# File 'lib/dogapi/v1/comment.rb', line 13 def comment(, = {}) body = { 'message' => , }.merge request(Net::HTTP::Post, "/api/#{API_VERSION}/comments", nil, body, true) end |
#delete_comment(comment_id) ⇒ Object
26 27 28 |
# File 'lib/dogapi/v1/comment.rb', line 26 def delete_comment(comment_id) request(Net::HTTP::Delete, "/api/#{API_VERSION}/comments/#{comment_id}", nil, nil, false) end |
#update_comment(comment_id, options = {}) ⇒ Object
Update a comment.
22 23 24 |
# File 'lib/dogapi/v1/comment.rb', line 22 def update_comment(comment_id, = {}) request(Net::HTTP::Put, "/api/#{API_VERSION}/comments/#{comment_id}", nil, , true) end |