Class: OFX::Tokenizer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx_kit/tokenizer/base.rb

Overview

Abstract base class for OFX tokenizers. Subclasses must implement #parse! to populate @headers and @body from the raw file content.

Direct Known Subclasses

OFX1, OFX2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Base

Creates a new tokenizer and immediately parses content (raw OFX String).



19
20
21
22
# File 'lib/ofx_kit/tokenizer/base.rb', line 19

def initialize(content)
  @content = content.dup.force_encoding('UTF-8')
  parse!
end

Instance Attribute Details

#bodyObject (readonly)

Parsed XML body (Nokogiri::XML::Document).



15
16
17
# File 'lib/ofx_kit/tokenizer/base.rb', line 15

def body
  @body
end

#headersObject (readonly)

Parsed header key/value pairs (Hash).



12
13
14
# File 'lib/ofx_kit/tokenizer/base.rb', line 12

def headers
  @headers
end