Module: Shikimori::API::V1::Constants

Included in:
Shikimori::API::V1
Defined in:
lib/shikimori/api/v1/constants.rb

Overview

Methods for the Constants API

Instance Method Summary collapse

Instance Method Details

#anime_constants(headers: nil, **query) ⇒ Hash

Get anime constants

Examples:

Get anime constants

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.anime_constants #=> { kind: [...], status: [...] }

Parameters:

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing constants

See Also:



25
26
27
# File 'lib/shikimori/api/v1/constants.rb', line 25

def anime_constants(headers: nil, **query)
  rest.get base_url.join('constants', 'anime').url, headers: headers, query: query
end

#club_constants(headers: nil, **query) ⇒ Hash

Get club constants

Examples:

Get club constants

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.club_constants #=> { join_policy: [...], comment_policy: [...], image_upload_policy: [...] }

Parameters:

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing constants

See Also:



82
83
84
# File 'lib/shikimori/api/v1/constants.rb', line 82

def club_constants(headers: nil, **query)
  rest.get base_url.join('constants', 'club').url, headers: headers, query: query
end

#manga_constants(headers: nil, **query) ⇒ Hash

Get manga constants

Examples:

Get manga constants

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.manga_constants #=> { kind: [...], status: [...] }

Parameters:

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing constants

See Also:



44
45
46
# File 'lib/shikimori/api/v1/constants.rb', line 44

def manga_constants(headers: nil, **query)
  rest.get base_url.join('constants', 'manga').url, headers: headers, query: query
end

#smileys_constants(headers: nil, **query) ⇒ Array<Hash>

Get list of smileys constants

Examples:

Get smileys constants

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.smileys_constants #=> [{ bbcode: '...', path: '...' }, ...]

Parameters:

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Array<Hash>)

    Array of hashes representing constants

See Also:



101
102
103
# File 'lib/shikimori/api/v1/constants.rb', line 101

def smileys_constants(headers: nil, **query)
  rest.get base_url.join('constants', 'smileys').url, headers: headers, query: query
end

#user_rate_constants(headers: nil, **query) ⇒ Hash

Get user rate constants

Examples:

Get user_rate constants

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v1.user_rate_constants #=> { status: [...] }

Parameters:

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing constants

See Also:



63
64
65
# File 'lib/shikimori/api/v1/constants.rb', line 63

def user_rate_constants(headers: nil, **query)
  rest.get base_url.join('constants', 'user_rate').url, headers: headers, query: query
end