Class: Hachi::Clients::User
Instance Attribute Summary
Attributes inherited from Base
#api_endpoint, #api_key, #api_version
Instance Method Summary collapse
-
#create(**payload) ⇒ Hash
Create a user.
-
#current ⇒ Hash
Get current user.
-
#delete_by_id(id) ⇒ String
Delete a user.
-
#get_by_id(id) ⇒ Hash
Get a user.
Methods inherited from Base
#delete, #get, #initialize, #patch, #post
Methods included from Awrence::Methods
#to_camel_keys, #to_camelback_keys
Constructor Details
This class inherits a constructor from Hachi::Clients::Base
Instance Method Details
#create(**payload) ⇒ Hash
Create a user
44 45 46 |
# File 'lib/hachi/clients/user.rb', line 44 def create(**payload) post("/user", json: payload) { |json| json } end |
#current ⇒ Hash
Get current user
11 12 13 |
# File 'lib/hachi/clients/user.rb', line 11 def current get("/user/current") { |json| json } end |
#delete_by_id(id) ⇒ String
Delete a user
33 34 35 |
# File 'lib/hachi/clients/user.rb', line 33 def delete_by_id(id) delete("/user/#{id}") { |json| json } end |
#get_by_id(id) ⇒ Hash
Get a user
22 23 24 |
# File 'lib/hachi/clients/user.rb', line 22 def get_by_id(id) get("/user/#{id}") { |json| json } end |