Class: QuidaxUser

Inherits:
QuidaxBaseObject show all
Defined in:
lib/quidax/objects/user.rb

Overview

Object for user related operations

Instance Attribute Summary

Attributes inherited from QuidaxBaseObject

#quidax

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from QuidaxBaseObject

get_request, #initialize, post_request, put_request, url

Constructor Details

This class inherits a constructor from QuidaxBaseObject

Class Method Details

.create_sub_account(q_object:, body:) ⇒ Object



26
27
28
29
30
31
# File 'lib/quidax/objects/user.rb', line 26

def self.(q_object:, body:)
  body.stringify_keys!
  Utils.check_missing_keys(required_keys: %w[email first_name last_name phone_number], keys: body.keys,
                           field: "body")
  post_request(q_object, API::USER_PATH, body)
end

.edit_account(q_object:, user_id:, body:) ⇒ Object



37
38
39
40
# File 'lib/quidax/objects/user.rb', line 37

def self.(q_object:, user_id:, body:)
  path = "#{API::USER_PATH}/#{user_id}"
  put_request(q_object, path, body)
end

.get_account_details(q_object:, user_id:) ⇒ Object



21
22
23
24
# File 'lib/quidax/objects/user.rb', line 21

def self.(q_object:, user_id:)
  path = "#{API::USER_PATH}/#{user_id}"
  get_request(q_object, path)
end

.get_all_sub_accounts(q_object:) ⇒ Object



33
34
35
# File 'lib/quidax/objects/user.rb', line 33

def self.get_all_sub_accounts(q_object:)
  get_request(q_object, API::USER_PATH)
end

Instance Method Details

#create_sub_account(body:) ⇒ Object



9
10
11
# File 'lib/quidax/objects/user.rb', line 9

def (body:)
  QuidaxUser.(q_object: @quidax, body: body)
end

#edit_account(user_id:, body:) ⇒ Object



17
18
19
# File 'lib/quidax/objects/user.rb', line 17

def (user_id:, body:)
  QuidaxUser.(q_object: @quidax, user_id: user_id, body: body)
end

#get_account_details(user_id:) ⇒ Object



5
6
7
# File 'lib/quidax/objects/user.rb', line 5

def (user_id:)
  QuidaxUser.(q_object: @quidax, user_id: user_id)
end

#get_all_sub_accountsObject



13
14
15
# File 'lib/quidax/objects/user.rb', line 13

def get_all_sub_accounts
  QuidaxUser.get_all_sub_accounts(q_object: @quidax)
end