Class: OmiseGO::User
- Inherits:
-
Base
- Object
- Base
- OmiseGO::User
show all
- Defined in:
- lib/omisego/user.rb
Instance Attribute Summary
Attributes inherited from Base
#client, #original_payload
Class Method Summary
collapse
-
.create(provider_user_id:, username:, metadata: {}, encrypted_metadata: {}, client: nil) ⇒ Object
-
.find(provider_user_id:, client: nil) ⇒ Object
-
.login(provider_user_id:, client: nil) ⇒ Object
-
.update(provider_user_id:, username:, metadata: {}, encrypted_metadata: {}, client: nil) ⇒ Object
-
.wallets(provider_user_id:, client: nil) ⇒ Object
Instance Method Summary
collapse
Methods inherited from Base
attributes, #error?, global_client, #initialize, #inspect, request, #success?
Constructor Details
This class inherits a constructor from OmiseGO::Base
Class Method Details
.create(provider_user_id:, username:, metadata: {}, encrypted_metadata: {}, client: nil) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/omisego/user.rb', line 15
def create(provider_user_id:, username:, metadata: {},
encrypted_metadata: {}, client: nil)
request(client).send('user.create', provider_user_id: provider_user_id,
username: username,
metadata: metadata,
encrypted_metadata: encrypted_metadata).data
end
|
.find(provider_user_id:, client: nil) ⇒ Object
10
11
12
13
|
# File 'lib/omisego/user.rb', line 10
def find(provider_user_id:, client: nil)
return ErrorHandler.handle(:nil_id) unless provider_user_id
request(client).send('user.get', provider_user_id: provider_user_id).data
end
|
.login(provider_user_id:, client: nil) ⇒ Object
6
7
8
|
# File 'lib/omisego/user.rb', line 6
def login(provider_user_id:, client: nil)
request(client).send('user.login', provider_user_id: provider_user_id).data
end
|
.update(provider_user_id:, username:, metadata: {}, encrypted_metadata: {}, client: nil) ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/omisego/user.rb', line 23
def update(provider_user_id:, username:, metadata: {},
encrypted_metadata: {}, client: nil)
request(client).send('user.update', provider_user_id: provider_user_id,
username: username,
metadata: metadata,
encrypted_metadata: encrypted_metadata).data
end
|
.wallets(provider_user_id:, client: nil) ⇒ Object
31
32
33
|
# File 'lib/omisego/user.rb', line 31
def wallets(provider_user_id:, client: nil)
request(client).send('user.get_wallets', provider_user_id: provider_user_id).data
end
|
Instance Method Details
#login(client: nil) ⇒ Object
36
37
38
|
# File 'lib/omisego/user.rb', line 36
def login(client: nil)
self.class.login(provider_user_id, client: client)
end
|
#update(username:, metadata: {}, encrypted_metadata: {}, client: nil) ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/omisego/user.rb', line 40
def update(username:, metadata: {}, encrypted_metadata: {}, client: nil)
self.class.update(provider_user_id: provider_user_id,
username: username,
metadata: metadata,
encrypted_metadata: encrypted_metadata,
client: client)
end
|
#wallets(client: nil) ⇒ Object
48
49
50
|
# File 'lib/omisego/user.rb', line 48
def wallets(client: nil)
self.class.wallets(provider_user_id: provider_user_id, client: client)
end
|