Skip to content

Commit c2e6cfe

Browse files
Refact parser to use OFX 1.0.2 for version 1xx files.
1 parent 356ea9d commit c2e6cfe

File tree

6 files changed

+8
-142
lines changed

6 files changed

+8
-142
lines changed

lib/ofx.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
require 'ofx/errors'
1010
require 'ofx/parser'
1111
require 'ofx/parser/ofx102'
12-
require 'ofx/parser/ofx103'
1312
require 'ofx/parser/ofx211'
1413
require 'ofx/foundation'
1514
require 'ofx/balance'

lib/ofx/parser.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ def initialize(resource)
1717
end
1818

1919
case headers["VERSION"]
20-
when /102|100/ then
20+
when /102|100|103/ then
2121
@parser = OFX102.new(:headers => headers, :body => body)
22-
when /103/ then
23-
@parser = OFX103.new(:headers => headers, :body => body)
2422
when /200|202|211|220/ then
2523
@parser = OFX211.new(:headers => headers, :body => body)
2624
else

lib/ofx/parser/ofx103.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

spec/fixtures/v103.ofx

Lines changed: 0 additions & 80 deletions
This file was deleted.

spec/ofx/ofx103_spec.rb

Lines changed: 0 additions & 51 deletions
This file was deleted.

spec/ofx/ofx_parser_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
expect(ofx.parser).to eql 'ofx-102-parser'
5555
end
5656

57+
it "uses 102 parser to parse version 103 ofx files" do
58+
expect(OFX::Parser::OFX102).to receive(:new).and_return('ofx-102-parser')
59+
60+
ofx = OFX::Parser::Base.new(ofx_2_example('103'))
61+
expect(ofx.parser).to eql 'ofx-102-parser'
62+
end
63+
5764
it "uses 211 parser to parse version 200 ofx files" do
5865
expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser')
5966

0 commit comments

Comments
 (0)