Module: Shikimori::API::V2::UserRates
- Included in:
- Shikimori::API::V2
- Defined in:
- lib/shikimori/api/v2/user_rates.rb
Overview
Methods for the User rates API
Instance Method Summary collapse
-
#create_user_rate(user_rate, headers: nil, **query) ⇒ Hash
Create a user rate.
-
#delete_user_rate(id, headers: nil, **query) ⇒ Boolean
Delete user rate.
-
#increment_user_rate(id, headers: nil, **query) ⇒ Hash
Increment episodes/chapters by 1 Requires ‘user_rates` oauth scope.
-
#update_user_rate(id, user_rate, headers: nil, **query) ⇒ Hash
Update a user rate.
-
#user_rate(id, headers: nil, **query) ⇒ Hash
Get an user rate by id.
-
#user_rates(headers: nil, **query) ⇒ Array<Hash>
Get list of user rates.
Instance Method Details
#create_user_rate(user_rate, headers: nil, **query) ⇒ Hash
Create a user rate. Requires ‘user_rates` oauth scope
90 91 92 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 90 def create_user_rate(user_rate, headers: nil, **query) rest.post base_url.join('user_rates').url, { user_rate: user_rate }, headers: headers, query: query end |
#delete_user_rate(id, headers: nil, **query) ⇒ Boolean
Delete user rate. Requires ‘user_rates` oauth scope
144 145 146 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 144 def delete_user_rate(id, headers: nil, **query) rest.delete base_url.join('user_rates', id.to_s).url, headers: headers, query: query end |
#increment_user_rate(id, headers: nil, **query) ⇒ Hash
Increment episodes/chapters by 1 Requires ‘user_rates` oauth scope
165 166 167 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 165 def increment_user_rate(id, headers: nil, **query) rest.post base_url.join('user_rates', id.to_s, 'increment').url, {}, headers: headers, query: query end |
#update_user_rate(id, user_rate, headers: nil, **query) ⇒ Hash
Update a user rate. Requires ‘user_rates` oauth scope
123 124 125 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 123 def update_user_rate(id, user_rate, headers: nil, **query) rest.put base_url.join('user_rates', id.to_s).url, { user_rate: user_rate }, headers: headers, query: query end |
#user_rate(id, headers: nil, **query) ⇒ Hash
Get an user rate by id
52 53 54 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 52 def user_rate(id, headers: nil, **query) rest.get base_url.join('user_rates', id.to_s).url, headers: headers, query: query end |
#user_rates(headers: nil, **query) ⇒ Array<Hash>
Get list of user rates
32 33 34 |
# File 'lib/shikimori/api/v2/user_rates.rb', line 32 def user_rates(headers: nil, **query) rest.get base_url.join('user_rates').url, headers: headers, query: query end |