Module: Booru::API::Artist

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

Instance Method Summary collapse

Instance Method Details

#create_artist(options = {}) ⇒ Object

Create: This action creates an artist TODO Optional args?

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

:artist[name]  - The artist's name.
:artist[urls]  - A list of URLs associated with the
                 artist, whitespace delimited.
:artist[alias] - The artist that this artist is an
                 alias for. Simply enter the alias
                 artist's name.
:artist[group] - The group or cicle that this artist is a
                 member of. Simply enter the group's name.


32
33
34
35
36
# File 'lib/booru/api/artist.rb', line 32

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

#destroy_artist(options = {}) ⇒ Object Also known as: delete_artist

Destroy: This action deletes an artist

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

:id - The id of the artist to destroy.

You must be logged in to delete artists.



65
66
67
68
69
# File 'lib/booru/api/artist.rb', line 65

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

#list_artists(options = {}) ⇒ Object

List: This action retrieves a list of artists TODO optional args?

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

:name  - The name (or a fragment of the name) of the
         artist.
:order - Can be date or name.
:page  - The page number (default: 1)


14
15
16
17
18
# File 'lib/booru/api/artist.rb', line 14

def list_artists(options = {})
  base_url = '/artist/index'
  query = query_string(base_url, options)
  parse(get(query))
end

#update_artist(options = {}) ⇒ Object

Update: This action updates an artist’s attributes

Only the id parameter is required.

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

:id            - The id of thr artist to update.
:artist[name]  - The artist's name (optional).
:artist[urls]  - A list of URLs associated with the
                 artist, whitespace delimited (optional).
:artist[alias] - The artist that this artist is an
                 alias for. Simply enter the alias
                 artist's name (optional).
:artist[group] - The group or cicle that this artist is a
                 member of. Simply enter the group's name
                 (optional).


53
54
55
56
57
# File 'lib/booru/api/artist.rb', line 53

def update_artist(options = {})
  base_url = '/artist/update'
  query = query_string(base_url, options)
  parse(post(query))
end