Class: BankAccountStatement::Outputs::OFX::V_2_1_1

Inherits:
Base
  • Object
show all
Defined in:
lib/bank-account-statement/outputs/OFX/V_2_1_1.rb

Overview

OFX 2.1.1 statement generation.

Constant Summary collapse

OFX_STRFTIME =
'%Y%m%d%H%M%S.%L[%:::z]'.freeze
OFX_HEADER =
[
  '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.freeze,
  '<?OFX OFXHEADER="200" VERSION="211" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>'.freeze,
].freeze

Constants inherited from Base

Base::FILE_EXT

Instance Method Summary collapse

Methods inherited from Base

formats, inherited, #initialize

Constructor Details

This class inherits a constructor from BankAccountStatement::Outputs::Base

Instance Method Details

#generateObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bank-account-statement/outputs/OFX/V_2_1_1.rb', line 20

def generate
  _xml = case @data[:account][:type]
  when :CREDITLINE
    _xml_credit_card
  else
    _xml_bank_statement
  end
  
  xml_b = _xml.to_xml.split("\n").drop(1) # :|
  (OFX_HEADER + xml_b).join("\n")
end