Class: OFX::Parser::OFX211

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

Constant Summary collapse

VERSION =
"2.1.1"

Constants inherited from OFX102

OFX::Parser::OFX102::ACCOUNT_TYPES, OFX::Parser::OFX102::TRANSACTION_TYPES

Instance Attribute Summary

Attributes inherited from OFX102

#body, #headers, #html

Class Method Summary collapse

Methods inherited from OFX102

#account, #initialize

Constructor Details

This class inherits a constructor from OFX::Parser::OFX102

Class Method Details

.parse_headers(header_text) ⇒ Object



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

def self.parse_headers(header_text)
  doc = Nokogiri::XML(header_text)

  # Nokogiri can't search for processing instructions, so we
  # need to do this manually.
  doc.children.each do |e|
    if e.type == Nokogiri::XML::Node::PI_NODE && e.name == "OFX"
      # Getting the attributes from the element doesn't seem to
      # work either.
      return extract_headers(e.text)
    end
  end

  nil
end