class BlueBank::Customer
Attributes
client[R]
Public Class Methods
new(client:)
click to toggle source
# File lib/blue_bank/customer.rb, line 3 def initialize(client:) @client = client end
Public Instance Methods
accounts()
click to toggle source
# File lib/blue_bank/customer.rb, line 15 def accounts @accounts ||= AccountList.new(customer: self, client: client) end
current_account()
click to toggle source
# File lib/blue_bank/customer.rb, line 19 def current_account accounts.find(&:current?) end
given_name()
click to toggle source
# File lib/blue_bank/customer.rb, line 11 def given_name json.fetch("givenName") end
id()
click to toggle source
# File lib/blue_bank/customer.rb, line 7 def id json.fetch("id") end
Private Instance Methods
json()
click to toggle source
# File lib/blue_bank/customer.rb, line 25 def json @json ||= client.get("/customers").first end