Class: BankAccountStatement::Inputs::HTML::CPBKGB22::Personal::Base
- Inherits:
-
Base
- Object
- Base
- Base
- BankAccountStatement::Inputs::HTML::CPBKGB22::Personal::Base
show all
- Defined in:
- lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/base.rb
Constant Summary
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
12
13
14
15
16
17
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/base.rb', line 12
def account
{
:id => _bank_account_ids[:account_id],
:type => self.class::ACCOUNT_TYPE,
}
end
|
#currency ⇒ Object
19
20
21
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/base.rb', line 19
def currency
:GBP
end
|
#transactions ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/bank-account-statement/inputs/HTML/CPBKGB22/Personal/base.rb', line 23
def transactions
_transaction_rows.map { |r|
begin
posted_at = Date.parse(r[self.class::TH[:date]])
rescue ArgumentError
next end
a = if self.class::TH.has_key?(:amount)
_clean_amount(r[self.class::TH[:amount]])
else
_transaction_amount(
r[self.class::TH[:deposit]],
r[self.class::TH[:withdrawal]]
)
end
{
:posted_at => posted_at,
:type => _transaction_type(r[self.class::TH[:desc]], a),
:name => r[self.class::TH[:desc]].strip,
:amount => a,
}
}.compact
end
|