Class: SaltParser::Ofx::Parser::OFX211

Inherits:
Base
  • Object
show all
Defined in:
lib/ofx/parser/ofx211.rb

Constant Summary collapse

VERSION =
"2.1.1"

Constants inherited from Base

Base::ACCOUNT_TYPES, Base::TRANSACTION_TYPES

Instance Attribute Summary

Attributes inherited from Base

#accounts, #body, #errors, #headers, #html, #sign_on

Class Method Summary collapse

Methods inherited from Base

#build_accounts, #initialize, #to_hash

Constructor Details

This class inherits a constructor from SaltParser::Ofx::Parser::Base

Class Method Details

.parse_headers(header_text) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ofx/parser/ofx211.rb', line 7

def self.parse_headers(header_text)
  Nokogiri::XML(header_text).children.each do |element|
    if element.name == "OFX"
      headers = element.text.gsub("\"",'')
                       .split(/\s+/)
                       .map { |el| el.split("=") }
                       .flatten
      return Hash[*headers]
    end
  end
end