Class: Round::User

Inherits:
Base
  • Object
show all
Defined in:
lib/round/user.rb

Instance Attribute Summary

Attributes inherited from Base

#resource

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

association, #hash_identifier, #method_missing, #refresh

Constructor Details

#initialize(resource:, client:, **kwargs) ⇒ User

Returns a new instance of User.



9
10
11
12
# File 'lib/round/user.rb', line 9

def initialize(resource:, client:, **kwargs)
  super
  @resource.attributes.merge! kwargs
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Round::Base

Class Method Details

.hash_identifierObject



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

def self.hash_identifier
  'email'
end

Instance Method Details

#devicesObject



14
15
16
17
18
19
20
21
22
# File 'lib/round/user.rb', line 14

def devices
  resource = @client.resources.devices_query(
    email: self.email
  )
  Round::DeviceCollection.new(
    resource: resource,
    client: @client
  )
end

#walletObject



24
25
26
# File 'lib/round/user.rb', line 24

def wallet
  default_wallet
end