Module: Shikimori::API::V1::UserRates
- Included in:
- Shikimori::API::V1
- Defined in:
- lib/shikimori/api/v1/user_rates.rb
Overview
Methods for the User rates API
Instance Method Summary collapse
-
#cleanup_user_rates(type, headers: nil, **query) ⇒ Boolean
Delete entire user rates and history.
-
#create_user_rate(user_rate, headers: nil, **query) ⇒ Hash
deprecated
Deprecated.
Use Shikimori::API::V2::UserRates#create_user_rate instead
-
#delete_user_rate(id, headers: nil, **query) ⇒ Boolean
deprecated
Deprecated.
Use Shikimori::API::V2::UserRates#delete_user_rate instead
- #increment_user_rate(id, headers: nil, **query) ⇒ Hash deprecated Deprecated.
-
#reset_user_rates(type, headers: nil, **query) ⇒ Boolean
Reset all user scores to 0.
-
#update_user_rate(id, user_rate, headers: nil, **query) ⇒ Hash
deprecated
Deprecated.
Use Shikimori::API::V2::UserRates#update_user_rate instead
-
#user_rate(id, headers: nil, **query) ⇒ Hash
deprecated
Deprecated.
Use Shikimori::API::V2::UserRates#user_rate instead
Instance Method Details
#cleanup_user_rates(type, headers: nil, **query) ⇒ Boolean
Delete entire user rates and history
168 169 170 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 168 def cleanup_user_rates(type, headers: nil, **query) rest.delete base_url.join('user_rates', type.to_s, 'cleanup').url, headers: headers, query: query end |
#create_user_rate(user_rate, headers: nil, **query) ⇒ Hash
Use Shikimori::API::V2::UserRates#create_user_rate instead
Create a user rate. Requires ‘user_rates` oauth scope
68 69 70 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 68 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
Use Shikimori::API::V2::UserRates#delete_user_rate instead
Delete user rate
125 126 127 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 125 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
148 149 150 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 148 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 |
#reset_user_rates(type, headers: nil, **query) ⇒ Boolean
Reset all user scores to 0
188 189 190 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 188 def reset_user_rates(type, headers: nil, **query) rest.delete base_url.join('user_rates', type.to_s, 'reset').url, headers: headers, query: query end |
#update_user_rate(id, user_rate, headers: nil, **query) ⇒ Hash
Use Shikimori::API::V2::UserRates#update_user_rate instead
Update a user rate. Requires ‘user_rates` oauth scope
103 104 105 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 103 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
Use Shikimori::API::V2::UserRates#user_rate instead
Get an user rate by id
28 29 30 |
# File 'lib/shikimori/api/v1/user_rates.rb', line 28 def user_rate(id, headers: nil, **query) rest.get base_url.join('user_rates', id.to_s).url, headers: headers, query: query end |