Module: Booru::API::Tag

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

Instance Method Summary collapse

Instance Method Details

Related: This action retrieves a list of related tags TODO optional/required args

options - The Hash used to refine the selection (default: {}): :tags - The tag names to query. :type - Restrict results to this tag type (can be general, artist, copyright, or character).



48
49
50
51
52
# File 'lib/booru/api/tag.rb', line 48

def list_related_tags(options = {})
  base_url = 'tag/related'
  query = query_string(base_url, options)
  parse(get(query))
end

#list_tags(options = {}) ⇒ Object

List: This action retrieves a list of tags TODO optional/required args

options - The Hash used to refine the selection (default: {}): :limit - How many tags to retrieve. Setting this to 0 will return every tag. :page - The page number. :order - Can be date, count, or name. :id - The id number of the tag. :after_id - Return all tags that have an id number greater than this. :name - The exact name of the tag. :name_pattern - Search for any tag that has this parameter in its name.



20
21
22
23
24
# File 'lib/booru/api/tag.rb', line 20

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

#update_tag(options = {}) ⇒ Object

Update: This action modifies a specified tag TODO optional/required args

options - The Hash used to refine the selection (default: {}): :name - The name of the tag to update. :tag - The tag type. General: 0, artist: 1, copyright: 3, character: 4. :tag - Whether or not this tag is ambiguous. Use 1 for true.



35
36
37
38
39
# File 'lib/booru/api/tag.rb', line 35

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