Class: BankScrap::Account

Inherits:
Object
  • Object
show all
Includes:
Utils::Inspectable
Defined in:
lib/bank_scrap/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Inspectable

#inspect

Constructor Details

#initialize(params = {}) ⇒ Account

Returns a new instance of Account.



9
10
11
# File 'lib/bank_scrap/account.rb', line 9

def initialize(params = {})
  params.each { |key, value| send "#{key}=", value }
end

Instance Attribute Details

#available_balanceObject

Returns the value of attribute available_balance.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def available_balance
  @available_balance
end

#balanceObject

Returns the value of attribute balance.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def balance
  @balance
end

#bankObject

Returns the value of attribute bank.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def bank
  @bank
end

#bicObject

Returns the value of attribute bic.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def bic
  @bic
end

#currencyObject

Returns the value of attribute currency.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def currency
  @currency
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def description
  @description
end

#ibanObject

Returns the value of attribute iban.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def iban
  @iban
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def id
  @id
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def name
  @name
end

#transactionsObject

Returns the value of attribute transactions.



5
6
7
# File 'lib/bank_scrap/account.rb', line 5

def transactions
  @transactions
end

Instance Method Details

#fetch_transactions(start_date: Date.today - 2.years, end_date: Date.today) ⇒ Object



17
18
19
# File 'lib/bank_scrap/account.rb', line 17

def fetch_transactions(start_date: Date.today - 2.years, end_date: Date.today)
  bank.fetch_transactions_for(self, start_date: start_date, end_date: end_date)
end