Class: BlueBank::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/blue_bank/customer.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Customer

Returns a new instance of Customer.



3
4
5
# File 'lib/blue_bank/customer.rb', line 3

def initialize(client:)
  @client = client
end

Instance Method Details

#accountsObject



15
16
17
# File 'lib/blue_bank/customer.rb', line 15

def accounts
  @accounts ||= AccountList.new(customer: self, client: client)
end

#current_accountObject



19
20
21
# File 'lib/blue_bank/customer.rb', line 19

def 
  accounts.find(&:current?)
end

#given_nameObject



11
12
13
# File 'lib/blue_bank/customer.rb', line 11

def given_name
  json.fetch("givenName")
end

#idObject



7
8
9
# File 'lib/blue_bank/customer.rb', line 7

def id
  json.fetch("id")
end