Class: Financial::AccountManager

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/financial/account_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAccountManager

Returns a new instance of AccountManager.



8
9
10
# File 'lib/financial/account_manager.rb', line 8

def initialize
  @accounts = []
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



6
7
8
# File 'lib/financial/account_manager.rb', line 6

def accounts
  @accounts
end

Instance Method Details

#find_account(account_name) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/financial/account_manager.rb', line 18

def ()
  if  == :all or  == :todas
    @accounts
  else
    @accounts.select { || .name.equal?() }
  end
end

#new_account(args) ⇒ Object



12
13
14
15
16
# File 'lib/financial/account_manager.rb', line 12

def (args)
   = Account.new(args)
  @accounts.push()
  
end