Module: ExtrasDeCont
- Defined in:
- lib/extras_de_cont.rb,
lib/extras_de_cont/parser.rb,
lib/extras_de_cont/rules/brd.rb,
lib/extras_de_cont/rules/ing.rb,
lib/extras_de_cont/rules/base.rb,
lib/extras_de_cont/transaction.rb,
lib/extras_de_cont/rules/revolut.rb,
lib/extras_de_cont/rules/unicredit.rb
Overview
The ExtrasDeCont module contains utilities for parsing bank statements.
Defined Under Namespace
Modules: Rules Classes: Parser, Transaction
Constant Summary collapse
- BANK_RULES =
Map of supported banks (symbol → rule class)
{ brd: Rules::Brd, ing: Rules::Ing, revolut: Rules::Revolut, unicredit: Rules::UniCredit }.freeze
Class Method Summary collapse
-
.parse(file, bank:) ⇒ Array<ExtrasDeCont::Transaction>
Parses a PDF bank statement and returns structured transactions.
Class Method Details
.parse(file, bank:) ⇒ Array<ExtrasDeCont::Transaction>
Parses a PDF bank statement and returns structured transactions.
27 28 29 30 31 32 33 |
# File 'lib/extras_de_cont.rb', line 27 def parse(file, bank:) rule_class = BANK_RULES[bank] raise ArgumentError, "Unsupported bank: #{bank}. Supported banks: #{BANK_RULES.keys.join(", ")}" unless rule_class p = Parser.new(file) p.parse_with(rule_class.new) end |