Class: DBLista::User::Client
- Inherits:
-
Object
- Object
- DBLista::User::Client
- Includes:
- Actions, Boosting, Notifications, Rating, Verification, Voting
- Defined in:
- lib/dblista/user/client.rb
Overview
DBLista 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
-
#guilds ⇒ Hash
Fetches current user guilds.
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
-
#me ⇒ Hash
Fetches information about current user.
Methods included from Verification
#approve, #reject, #set_pending
Methods included from Notifications
#clear_notifications, #notifications, #send_group_notification, #send_notification
Methods included from Rating
Methods included from Boosting
Methods included from Actions
#add, #delete, #edit, #manage_user
Methods included from Voting
Constructor Details
#initialize(token) ⇒ Client
Returns a new instance of Client.
34 35 36 37 38 39 40 |
# File 'lib/dblista/user/client.rb', line 34 def initialize(token) raise DBLista::Error, DBLista::Errors::TOKEN_NOT_PROVIDED unless token @token = token me end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
32 33 34 |
# File 'lib/dblista/user/client.rb', line 32 def token @token end |
Instance Method Details
#guilds ⇒ Hash
Fetches current user guilds
52 53 54 |
# File 'lib/dblista/user/client.rb', line 52 def guilds DBLista._get('/users/me/guilds', @token) end |
#me ⇒ Hash
Fetches information about current user
45 46 47 |
# File 'lib/dblista/user/client.rb', line 45 def me DBLista._get('/users/me', @token) end |