Class: Confy::Api::User
- Inherits:
-
Object
- Object
- Confy::Api::User
- Defined in:
- lib/confy/api/user.rb
Overview
User who is authenticated currently.
Instance Method Summary collapse
-
#initialize(client) ⇒ User
constructor
A new instance of User.
-
#retrieve(options = {}) ⇒ Object
Get the authenticated user’s profile.
-
#update(options = {}) ⇒ Object
Update the authenticated user’s profile.
Constructor Details
#initialize(client) ⇒ User
Returns a new instance of User.
8 9 10 |
# File 'lib/confy/api/user.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#retrieve(options = {}) ⇒ Object
Get the authenticated user’s profile.
‘/user’ GET
15 16 17 18 19 |
# File 'lib/confy/api/user.rb', line 15 def retrieve( = {}) body = .fetch(:query, {}) @client.get("/user", body, ) end |
#update(options = {}) ⇒ Object
Update the authenticated user’s profile. Should use basic authentication.
‘/user’ PATCH
25 26 27 28 29 |
# File 'lib/confy/api/user.rb', line 25 def update( = {}) body = .fetch(:body, {}) @client.patch("/user", body, ) end |