Class: BankAccountStatement::Inputs::HTML::CPBKGB22::Personal::Current::Base
- Inherits:
-
Base
- Object
- Base
- Base
- BankAccountStatement::Inputs::HTML::CPBKGB22::Personal::Current::Base
show all
- Defined in:
- lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb
Constant Summary
collapse
- ACCOUNT_TYPE =
:CHECKING
Constants inherited
from Base
Base::FILE_EXT
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Methods inherited from Base
formats, inherited, #parse
Instance Method Details
#account ⇒ Object
24
25
26
27
28
29
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb', line 24
def account
{
:id => _bank_account_ids[:account_id],
:type => self.class::ACCOUNT_TYPE,
}
end
|
#balance ⇒ Object
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb', line 51
def balance
r = _transaction_rows.last
{
:ledger => {
:balanced_at => Date.parse(r[self.class::TH[:date]]),
:amount => _clean_amount(r[self.class::TH[:balance]]),
},
}
end
|
#bank ⇒ Object
18
19
20
21
22
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb', line 18
def bank
{
:id => _bank_account_ids[:bank_id].tr('-', ''),
}
end
|
#currency ⇒ Object
31
32
33
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb', line 31
def currency
:GBP
end
|
#transactions ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/Current/base.rb', line 35
def transactions
_transaction_rows.map { |r|
a = _transaction_amount(
r[self.class::TH[:deposit]],
r[self.class::TH[:withdrawal]]
)
{
:posted_at => Date.parse(r[self.class::TH[:date]]),
:type => _transaction_type(r[self.class::TH[:desc]], a),
:name => r[self.class::TH[:desc]].strip,
:amount => a,
}
}
end
|