Module: Shikimori::API::V1::Users
- Included in:
- Shikimori::API::V1
- Defined in:
- lib/shikimori/api/v1/users.rb
Overview
Methods for the Users API
Instance Method Summary collapse
-
#sign_out(headers: nil, **query) ⇒ Hash
Sign out the user.
-
#user(id, headers: nil, **query) ⇒ Hash
Get an user.
-
#user_anime_rates(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s anime rates.
-
#user_bans(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s bans.
-
#user_clubs(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s clubs.
-
#user_favorites(id, headers: nil, **query) ⇒ Hash
Get an user’s favorites.
-
#user_friends(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s friends.
-
#user_history(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s history.
-
#user_info(id, headers: nil, **query) ⇒ Hash
Get an user’s brief info.
-
#user_manga_rates(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s manga rates.
-
#user_messages(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s messages Requires ‘messages` oauth scope.
-
#user_unread_messages(id, headers: nil, **query) ⇒ Hash
Get an user’s unread messages Requires ‘messages` oauth scope.
-
#users(headers: nil, **query) ⇒ Array<Hash>
Get list of users.
-
#whoami(headers: nil, **query) ⇒ Hash
Get an current user’s brief info.
Instance Method Details
#sign_out(headers: nil, **query) ⇒ Hash
Sign out the user
108 109 110 |
# File 'lib/shikimori/api/v1/users.rb', line 108 def sign_out(headers: nil, **query) rest.get base_url.join('users', 'sign_out').url, headers: headers, query: query end |
#user(id, headers: nil, **query) ⇒ Hash
Get an user
50 51 52 |
# File 'lib/shikimori/api/v1/users.rb', line 50 def user(id, headers: nil, **query) rest.get base_url.join('users', id.to_s).url, headers: headers, query: query end |
#user_anime_rates(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s anime rates
172 173 174 |
# File 'lib/shikimori/api/v1/users.rb', line 172 def user_anime_rates(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'anime_rates').url, headers: headers, query: query end |
#user_bans(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s bans
304 305 306 |
# File 'lib/shikimori/api/v1/users.rb', line 304 def user_bans(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'bans').url, headers: headers, query: query end |
#user_clubs(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s clubs
148 149 150 |
# File 'lib/shikimori/api/v1/users.rb', line 148 def user_clubs(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'clubs').url, headers: headers, query: query end |
#user_favorites(id, headers: nil, **query) ⇒ Hash
Get an user’s favorites
215 216 217 |
# File 'lib/shikimori/api/v1/users.rb', line 215 def user_favorites(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'favourites').url, headers: headers, query: query end |
#user_friends(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s friends
128 129 130 |
# File 'lib/shikimori/api/v1/users.rb', line 128 def user_friends(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'friends').url, headers: headers, query: query end |
#user_history(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s history
284 285 286 |
# File 'lib/shikimori/api/v1/users.rb', line 284 def user_history(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'history').url, headers: headers, query: query end |
#user_info(id, headers: nil, **query) ⇒ Hash
Get an user’s brief info
70 71 72 |
# File 'lib/shikimori/api/v1/users.rb', line 70 def user_info(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'info').url, headers: headers, query: query end |
#user_manga_rates(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s manga rates
195 196 197 |
# File 'lib/shikimori/api/v1/users.rb', line 195 def user_manga_rates(id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'manga_rates').url, headers: headers, query: query end |
#user_messages(id, headers: nil, **query) ⇒ Array<Hash>
Get an user’s messages Requires ‘messages` oauth scope
239 240 241 |
# File 'lib/shikimori/api/v1/users.rb', line 239 def (id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'messages').url, headers: headers, query: query end |
#user_unread_messages(id, headers: nil, **query) ⇒ Hash
Get an user’s unread messages Requires ‘messages` oauth scope
260 261 262 |
# File 'lib/shikimori/api/v1/users.rb', line 260 def (id, headers: nil, **query) rest.get base_url.join('users', id.to_s, 'unread_messages').url, headers: headers, query: query end |
#users(headers: nil, **query) ⇒ Array<Hash>
Get list of users
29 30 31 |
# File 'lib/shikimori/api/v1/users.rb', line 29 def users(headers: nil, **query) rest.get base_url.join('users').url, headers: headers, query: query end |
#whoami(headers: nil, **query) ⇒ Hash
Get an current user’s brief info
89 90 91 |
# File 'lib/shikimori/api/v1/users.rb', line 89 def whoami(headers: nil, **query) rest.get base_url.join('users', 'whoami').url, headers: headers, query: query end |