Class: BlueBank::Customer
- Inherits:
-
Object
- Object
- BlueBank::Customer
- Defined in:
- lib/blue_bank/customer.rb
Instance Method Summary collapse
- #accounts ⇒ Object
- #current_account ⇒ Object
- #given_name ⇒ Object
- #id ⇒ Object
-
#initialize(client:) ⇒ Customer
constructor
A new instance of Customer.
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
#accounts ⇒ Object
15 16 17 |
# File 'lib/blue_bank/customer.rb', line 15 def accounts @accounts ||= AccountList.new(customer: self, client: client) end |
#current_account ⇒ Object
19 20 21 |
# File 'lib/blue_bank/customer.rb', line 19 def current_account accounts.find(&:current?) end |
#given_name ⇒ Object
11 12 13 |
# File 'lib/blue_bank/customer.rb', line 11 def given_name json.fetch("givenName") end |
#id ⇒ Object
7 8 9 |
# File 'lib/blue_bank/customer.rb', line 7 def id json.fetch("id") end |