Module: Shikimori::API::V1::TopicIgnores Deprecated

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

Overview

Deprecated.

Methods for the Topic ignores API

Instance Method Summary collapse

Instance Method Details

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

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

Examples:

Add to ignore a user with id equal to 1 at topic with id equal to 1

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

Parameters:

  • topic_id (Integer)

    Topic id where to add

  • user_id (Integer)

    User id that add to ignores

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing created topic ignore

See Also:



32
33
34
35
36
# File 'lib/shikimori/api/v1/topic_ignores.rb', line 32

def create_topic_ignore(topic_id:, user_id:, headers: nil, **query)
  payload = { topic_ignore: { topic_id: topic_id, user_id: user_id } }

  rest.post base_url.join('topic_ignores').url, payload, headers: headers, query: query
end

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

Delete a user from topic ignores 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.v1.delete_topic_ignore(1)

Parameters:

  • id (#to_s)

    Topic ignore 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:



57
58
59
# File 'lib/shikimori/api/v1/topic_ignores.rb', line 57

def delete_topic_ignore(id, headers: nil, **query)
  rest.delete base_url.join('topic_ignores', id.to_s).url, headers: headers, query: query
end