Module: Booru::API::Comment

Included in:
Client
Defined in:
lib/booru/api/comment.rb

Instance Method Summary collapse

Instance Method Details

#create_comment(options = {}) ⇒ Object Also known as: post_comment

Create: This action creates a comment

options - The Hash used to refine the selection (default: {}):

:comment[anonymous] - Set to 1 if you want to post this
                      comment anonymously (optional).
:comment[post_id]   - The post id number to which you are
                      responding.
:comment[body]      - The body of the comment.


24
25
26
27
28
# File 'lib/booru/api/comment.rb', line 24

def create_comment(options = {})
  base_url = '/comment/create'
  query = query_string(base_url, options)
  parse(post(query))
end

#destroy_comment(options = {}) ⇒ Object Also known as: delete_comment

Destroy: This action deletes a comment

options - The Hash used to refine the selection (default: {}):

:id - The id number of the comment to delete.

You must be logged in to use this action. You must also be the owner of the comment, or you must be a moderator.



39
40
41
42
43
# File 'lib/booru/api/comment.rb', line 39

def destroy_comment(options = {})
  base_url = '/comment/destroy'
  query = query_string(base_url, options)
  parse(post(query))
end

#show_comment(options = {}) ⇒ Object

Show: This action retrieves a single comment.

options - The Hash used to refine the selection (default: {}):

:id - The id number of the comment to retrieve.


10
11
12
13
14
# File 'lib/booru/api/comment.rb', line 10

def show_comment(options = {})
  base_url = '/comment/destroy'
  query = query_string(base_url, options)
  parse(get(query))
end