Module: Voog::API::Comments
- Included in:
- Client
- Defined in:
- lib/voog_api/api/comments.rb
Overview
Voog article Comments API methods.
Instance Method Summary collapse
-
#comment(article_id, id, params = {}) ⇒ Object
Get a single comment for article.
-
#comments(article_id, params = {}) ⇒ Object
List article comments.
-
#create_comment(article_id, data) ⇒ Object
Create a comment.
-
#delete_comment(article_id, id) ⇒ Object
Delete an article comment.
-
#delete_spam_comments(article_id) ⇒ Object
Delete all spam comment for article.
-
#toggle_spam_comment(article_id, id) ⇒ Object
Toggle comment spam flag.
Instance Method Details
#comment(article_id, id, params = {}) ⇒ Object
Get a single comment for article
19 20 21 |
# File 'lib/voog_api/api/comments.rb', line 19 def comment(article_id, id, params = {}) get "articles/#{article_id}/comments/#{id}", {query: params} end |
#comments(article_id, params = {}) ⇒ Object
List article comments
12 13 14 |
# File 'lib/voog_api/api/comments.rb', line 12 def comments(article_id, params = {}) paginate "articles/#{article_id}/comments", {query: params} end |
#create_comment(article_id, data) ⇒ Object
Create a comment
26 27 28 |
# File 'lib/voog_api/api/comments.rb', line 26 def create_comment(article_id, data) post "articles/#{article_id}/comments", data end |
#delete_comment(article_id, id) ⇒ Object
Delete an article comment
40 41 42 |
# File 'lib/voog_api/api/comments.rb', line 40 def delete_comment(article_id, id) delete "articles/#{article_id}/comments/#{id}" end |
#delete_spam_comments(article_id) ⇒ Object
Delete all spam comment for article
47 48 49 |
# File 'lib/voog_api/api/comments.rb', line 47 def delete_spam_comments(article_id) delete "articles/#{article_id}/comments/delete_spam" end |
#toggle_spam_comment(article_id, id) ⇒ Object
Toggle comment spam flag
33 34 35 |
# File 'lib/voog_api/api/comments.rb', line 33 def toggle_spam_comment(article_id, id) put "articles/#{article_id}/comments/#{id}/toggle_spam", nil end |