Class: Confy::Api::User

Inherits:
Object
  • Object
show all
Defined in:
lib/confy/api/user.rb

Overview

User who is authenticated currently.

Instance Method Summary collapse

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(options = {})
  body = options.fetch(:query, {})

  @client.get("/user", body, options)
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(options = {})
  body = options.fetch(:body, {})

  @client.patch("/user", body, options)
end