Sha256: 5ba179ea65dfb00db7d8cff03787fc83b90818cc6d775cfb8874ca77f0ba4c80

Contents?: true

Size: 436 Bytes

Versions: 3

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true
module OFX
  class Parser
    attr_reader :body
    attr_accessor :output
    
    def initialize(body, options = {})
      @body = body
      @output = {}
      dump
    end

    def ofx_version
      @body[/VERSION:([0-9]{3})/, 1].to_i
    end

    def transactions
      @output[:transactions]
    end

    protected

    def dump
      @dump ||= Ox.sax_parse(Handler.new(self), @body)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ofx_ruby-0.0.13 lib/ofx/parser.rb
ofx_ruby-0.0.12 lib/ofx/parser.rb
ofx_ruby-0.0.11 lib/ofx/parser.rb