Class: DList::User::Client
- Inherits:
-
Object
- Object
- DList::User::Client
- Includes:
- Actions, Boosting, Information, Notifications, Rating, Verification, Voting
- Defined in:
- lib/dblista/user/client.rb
Overview
DList user client
Constant Summary collapse
- ALLOWED_TYPES =
Allowed entity types to use
%i[bot server].freeze
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
-
#joined_guilds ⇒ Hash
Fetches current user guilds.
-
#me ⇒ Hash
Fetches information about current user.
Methods included from Information
Methods included from Verification
#approve, #reject, #set_pending
Methods included from Notifications
#clear_notifications, #notifications, #send_group_notification, #send_notification
Methods included from Rating
#delete_rate, #delete_report, #rate, #report_rate, #reports
Methods included from Boosting
Methods included from Actions
#add, #delete, #edit, #generate_token, #manage_user, #reset_token
Methods included from Voting
Constructor Details
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
36 37 38 |
# File 'lib/dblista/user/client.rb', line 36 def token @token end |
Instance Method Details
#joined_guilds ⇒ Hash
Fetches current user guilds
59 60 61 62 63 |
# File 'lib/dblista/user/client.rb', line 59 def joined_guilds @cache.get(:guilds, lifetime: DList::CACHE_LIFETIME) do DList._get('/users/me/guilds', @token) end end |
#me ⇒ Hash
Fetches information about current user
50 51 52 53 54 |
# File 'lib/dblista/user/client.rb', line 50 def me @cache.get(:guilds, lifetime: DList::CACHE_LIFETIME) do DList._get('/users/me', @token) end end |