Class: OFXReader::Parser::OFX102

Inherits:
Struct
  • Object
show all
Defined in:
lib/ofx_reader/parser/ofx_102.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ofx_bodyObject

Returns the value of attribute ofx_body

Returns:

  • (Object)

    the current value of ofx_body



3
4
5
# File 'lib/ofx_reader/parser/ofx_102.rb', line 3

def ofx_body
  @ofx_body
end

Instance Method Details

#accountObject



8
9
10
11
12
13
# File 'lib/ofx_reader/parser/ofx_102.rb', line 8

def 
  {
    bank_id: ofx_body.search('BANKACCTFROM BANKID').inner_text,
    account_id: ofx_body.search('BANKACCTFROM ACCTID').inner_text,
  }
end

#parseObject



4
5
6
# File 'lib/ofx_reader/parser/ofx_102.rb', line 4

def parse
  [, transactions]
end

#transactionsObject



15
16
17
18
19
# File 'lib/ofx_reader/parser/ofx_102.rb', line 15

def transactions
  ofx_body.search('BANKTRANLIST STMTTRN').map do |node|
    build_transaction(node)
  end
end