Module: Shikimori::API::V2::TopicIgnore

Included in:
Shikimori::API::V2
Defined in:
lib/shikimori/api/v2/topic_ignore.rb

Overview

Methods for the Topic ignores API

Instance Method Summary collapse

Instance Method Details

#create_topic_ignore(topic_id, headers: nil, **query) ⇒ Hash

Add topic to ignore by id. Requires ‘topics` oauth scope

Examples:

Add to ignore a topic with id equal to 1

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v2.create_topic_ignore(1)

Parameters:

  • topic_id (#to_s)

    Topic id

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing created topic ignore

See Also:



27
28
29
# File 'lib/shikimori/api/v2/topic_ignore.rb', line 27

def create_topic_ignore(topic_id, headers: nil, **query)
  rest.post base_url.join('topics', topic_id.to_s, 'ignore').url, {}, headers: headers, query: query
end

#delete_topic_ignore(topic_id, headers: nil, **query) ⇒ Boolean

Delete a topic ignore by id. Requires ‘ignores` oauth scope

Examples:

Delete a topic ignore

client = Shikimori::API::Client.new(
  app_name: 'Api Test',
  aceess_token: '****',
  refresh_token: '****'
)
client.v2.delete_topic_ignore(1)

Parameters:

  • topic_id (#to_s)

    Topic id

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Boolean)

    True if deletion successful, false otherwise.

See Also:



48
49
50
# File 'lib/shikimori/api/v2/topic_ignore.rb', line 48

def delete_topic_ignore(topic_id, headers: nil, **query)
  rest.delete base_url.join('topics', topic_id.to_s, 'ignore').url, headers: headers, query: query
end