Module: DBLista::User::Rating
- Included in:
- Client
- Defined in:
- lib/dblista/user/rating.rb
Overview
User client - rating
Instance Method Summary collapse
-
#delete_rate(id, target_id = nil, type = :bot) ⇒ Boolean
Removes rate for a selected bot/server.
-
#rate(id, rating, details, type = :bot) ⇒ Boolean
Sends rate for a selected bot/server.
Instance Method Details
#delete_rate(id, target_id = nil, type = :bot) ⇒ Boolean
Removes rate for a selected bot/server
30 31 32 33 34 35 36 |
# File 'lib/dblista/user/rating.rb', line 30 def delete_rate(id, target_id = nil, type = :bot) DBLista._validate_id id raise DBLista::Error, DBLista::Errors::TYPE_NOT_ALLOWED unless DBLista::User::Client::ALLOWED_TYPES.include?(type) DBLista._delete("/#{type}s/#{id}/rate/#{target_id}", nil, @token) true end |
#rate(id, rating, details, type = :bot) ⇒ Boolean
Sends rate for a selected bot/server
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dblista/user/rating.rb', line 13 def rate(id, , details, type = :bot) DBLista._validate_id id raise DBLista::Error, DBLista::Errors::TYPE_NOT_ALLOWED unless DBLista::User::Client::ALLOWED_TYPES.include?(type) DBLista._post("/#{type}s/#{id}/rate", { rating: , details: details }, @token) true end |