Module: Shikimori::API::V2::UserIgnore

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

Overview

Methods for the User ignores API

Instance Method Summary collapse

Instance Method Details

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

Add user to ignore by id. Requires ‘ignores` oauth scope

Examples:

Add to ignore a user with id equal to 1

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

Parameters:

  • user_id (#to_s)

    User id

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Returns:

  • (Hash)

    Hash representing created user ignore

See Also:



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

def create_user_ignore(user_id, headers: nil, **query)
  rest.post base_url.join('users', user_id.to_s, 'ignore').url, {}, headers: headers, query: query
end

#delete_user_ignore(user_id, headers: nil, **query) ⇒ Boolean

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

Examples:

Delete a user ignore

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

Parameters:

  • user_id (#to_s)

    User 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/user_ignore.rb', line 48

def delete_user_ignore(user_id, headers: nil, **query)
  rest.delete base_url.join('users', user_id.to_s, 'ignore').url, headers: headers, query: query
end