ofx-data 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 155da44fb8b964ef9362d6c5f5964a740aefbc7f
4
- data.tar.gz: 90aaee4334f3e503ce94e97d22b99f55d6bbba7f
3
+ metadata.gz: d49bd2a900b068d029a4bae1e934a2e416776a40
4
+ data.tar.gz: d40240302747bef7b6316ff106e017a7a18b9d82
5
5
  SHA512:
6
- metadata.gz: 3d15ccf1823d3837a7b5df69531c4c653c6694f6d48ae12a4166dd2e04b035e61cbd7805acf476971e40070321ca4741db1c68c9485377ebb7936740ad1e4e48
7
- data.tar.gz: 35593573c42cb4807033a57482c94e6f5cd82a4cb4380f474d8b3895db7afcf1e737fe4f8208bd465bac6a5a9a89dc566d58474beadd272b5b2c93dacc588f64
6
+ metadata.gz: 8bedff47358dce38eff3c351ab5b64402270cd18b3e4f55dcdc7c026679ebba9c059ad7d85d8cd425228dde9c63a7af8b25eb9edbd291f2139f141e699e1224f
7
+ data.tar.gz: 9ac7297a6108ad4267199a0a2100dafa2fa4e3c596ed6241d0ad6a5eda33ebda10d28b28548bcc54243ddbc9b687f1d3f53d4071d0a4907c4d086200a6808fca
data/lib/ofx/data.rb CHANGED
@@ -1,9 +1,7 @@
1
1
  require "ofx/data/version"
2
2
  require "ofx/data/objects"
3
- require "ofx/data/serialization"
4
3
 
5
4
  module OFX
6
5
  module Data
7
- # Your code goes here...
8
6
  end
9
7
  end
@@ -6,7 +6,7 @@ module OFX
6
6
  attr_reader :message_sets, :declaration
7
7
 
8
8
  def initialize(opts = {})
9
- @message_sets = opts.fetch(:message_sets, []).freeze
9
+ @message_sets = opts.fetch(:message_sets)
10
10
  @declaration = opts.fetch(:declaration, Declaration.default)
11
11
  end
12
12
 
@@ -0,0 +1,33 @@
1
+ require "ofx/data/message_sets/signon"
2
+ require "ofx/data/message_sets/banking"
3
+
4
+ module OFX
5
+ module Data
6
+ class MessageSets
7
+ ORDER = [
8
+ :signon, :signup, :banking, :credit_card_statements,
9
+ :investment_statements, :interbank_funds_transfers,
10
+ :wire_funds_transfers, :payments, :general_email,
11
+ :investment_security_list, :biller_directory,
12
+ :bill_delivery, :fi_profile
13
+ ]
14
+ ORDER_LOOKUP = Hash[ORDER.each_with_index.map { |k, v| [k, v] }]
15
+
16
+ def initialize(message_sets)
17
+ @message_sets = message_sets
18
+ end
19
+
20
+ def ofx_type
21
+ :message_sets
22
+ end
23
+
24
+ def ordered_sets
25
+ @message_sets.sort_by { |set| ORDER_LOOKUP[set.message_set_type] }
26
+ end
27
+
28
+ def each(&block)
29
+ ordered_sets.each(&block)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,6 +1,6 @@
1
1
  module OFX
2
2
  module Data
3
- module MessageSet
3
+ class MessageSets
4
4
  module Banking
5
5
  MESSAGE_SET_TYPE = :banking
6
6
 
@@ -1,6 +1,6 @@
1
1
  module OFX
2
2
  module Data
3
- module MessageSet
3
+ class MessageSets
4
4
  module Signon
5
5
  MESSAGE_SET_TYPE = :signon
6
6
 
@@ -11,9 +11,19 @@ module OFX
11
11
  end
12
12
 
13
13
  class Response
14
+ attr_reader :message
15
+
16
+ def initialize(message)
17
+ @message = message
18
+ end
19
+
14
20
  def message_set_type
15
21
  MESSAGE_SET_TYPE
16
22
  end
23
+
24
+ def ofx_type
25
+ :"message_sets.signon.response"
26
+ end
17
27
  end
18
28
  end
19
29
  end
@@ -1,5 +1,5 @@
1
1
  require "ofx/data/document"
2
2
  require "ofx/data/transaction/status"
3
- require "ofx/data/message_set"
3
+ require "ofx/data/message_sets"
4
4
  require "ofx/data/banking"
5
5
 
@@ -1,18 +1,11 @@
1
- require "builder"
2
- require "ofx/data/serialization/registry"
3
1
  require "ofx/data/serialization/document"
4
- require "ofx/data/serialization/message_set"
2
+ require "ofx/data/serialization/message_sets"
5
3
  require "ofx/data/serialization/banking"
6
4
  require "ofx/data/serialization/transaction/status"
7
5
 
8
6
  module OFX
9
7
  module Data
10
8
  module Serialization
11
- def self.serialize(object)
12
- xml = Builder::XmlMarkup.new
13
- registry.serializer_for(object).serialize(object, xml)
14
- xml.target!
15
- end
16
9
  end
17
10
  end
18
11
  end
@@ -1,4 +1,3 @@
1
- require "ofx/data/serialization"
2
1
  require "ofx/data/serialization/common"
3
2
 
4
3
  module OFX
@@ -6,16 +5,18 @@ module OFX
6
5
  module Serialization
7
6
  module Banking
8
7
  class Balance
9
- extend Serialization::Common
8
+ include Serialization::Common
10
9
 
11
- def self.serialize(balance, builder)
10
+ def default_registry_entry_args
11
+ [:"banking.balance", nil]
12
+ end
13
+
14
+ def serialize(balance, builder)
12
15
  builder.BALAMT balance.amount.to_s("F")
13
16
  builder.DTASOF balance.date.strftime("%Y%m%d%H%M%S")
14
17
  end
15
18
  end
16
19
  end
17
-
18
- register Banking::Balance, :"banking.balance"
19
20
  end
20
21
  end
21
22
  end
@@ -1,4 +1,3 @@
1
- require "ofx/data/serialization"
2
1
  require "ofx/data/serialization/common"
3
2
 
4
3
  module OFX
@@ -6,7 +5,6 @@ module OFX
6
5
  module Serialization
7
6
  module Banking
8
7
  class BankAccount
9
- extend Serialization::Common
10
8
  ACCT_TYPES = {
11
9
  checking: "CHECKING".freeze,
12
10
  savings: "SAVINGS".freeze,
@@ -14,7 +12,13 @@ module OFX
14
12
  credit_line: "CREDITLINE"
15
13
  }
16
14
 
17
- def self.serialize(bank_account, builder)
15
+ include Serialization::Common
16
+
17
+ def default_registry_entry_args
18
+ [:"banking.bank_account", nil]
19
+ end
20
+
21
+ def serialize(bank_account, builder)
18
22
  builder.BANKID bank_account.bank_id
19
23
  if bank_account.branch_id != ""
20
24
  builder.BRANCHID bank_account.branch_id
@@ -26,13 +30,11 @@ module OFX
26
30
  end
27
31
  end
28
32
 
29
- def self.acct_type(type)
33
+ def acct_type(type)
30
34
  ACCT_TYPES.fetch(type)
31
35
  end
32
36
  end
33
37
  end
34
-
35
- register Banking::BankAccount, :"banking.bank_account"
36
38
  end
37
39
  end
38
40
  end
@@ -1,4 +1,3 @@
1
- require "ofx/data/serialization"
2
1
  require "ofx/data/serialization/common"
3
2
 
4
3
  module OFX
@@ -7,9 +6,13 @@ module OFX
7
6
  module Banking
8
7
  module Statement
9
8
  class Response
10
- extend Serialization::Common
9
+ include Serialization::Common
11
10
 
12
- def self.serialize(response, builder)
11
+ def default_registry_entry_args
12
+ [:"banking.statement.response", nil]
13
+ end
14
+
15
+ def serialize(response, builder)
13
16
  builder.STMTRS do |builder|
14
17
  builder.CURDEF response.curdef.to_s.upcase
15
18
  builder.BANKACCTFROM do |builder|
@@ -31,8 +34,6 @@ module OFX
31
34
  end
32
35
  end
33
36
  end
34
-
35
- register Banking::Statement::Response, :"banking.statement.response"
36
37
  end
37
38
  end
38
39
  end
@@ -1,4 +1,3 @@
1
- require "ofx/data/serialization"
2
1
  require "ofx/data/serialization/common"
3
2
 
4
3
  module OFX
@@ -8,24 +7,26 @@ module OFX
8
7
  module Statement
9
8
  module Transaction
10
9
  class Response
11
- extend Common
10
+ include Common
12
11
 
13
- def self.serialize(transaction, builder)
12
+ def default_registry_entry_args
13
+ [:"banking.statement.transaction.response", nil]
14
+ end
15
+
16
+ def serialize(transaction, builder)
14
17
  builder.STMTTRNRS do |builder|
15
18
  builder.TRNUID transaction.trnuid
16
19
  serialize_collection(children(transaction), builder)
17
20
  end
18
21
  end
19
22
 
20
- def self.children(transaction)
23
+ def children(transaction)
21
24
  [transaction.status, transaction.response]
22
25
  end
23
26
  end
24
27
  end
25
28
  end
26
29
  end
27
-
28
- register Banking::Statement::Transaction::Response, :"banking.statement.transaction.response"
29
30
  end
30
31
  end
31
32
  end
@@ -1,4 +1,3 @@
1
- require "ofx/data/serialization"
2
1
  require "ofx/data/serialization/common"
3
2
 
4
3
  module OFX
@@ -6,9 +5,14 @@ module OFX
6
5
  module Serialization
7
6
  module Banking
8
7
  class Transaction
9
- extend Serialization::Common
8
+ include Serialization::Common
10
9
 
11
- def self.serialize(transaction, builder)
10
+ def default_registry_entry_args
11
+ [:"banking.statement_transaction", nil]
12
+ end
13
+
14
+
15
+ def serialize(transaction, builder)
12
16
  builder.STMTTRN do |builder|
13
17
  builder.TRNTYPE transaction.type.to_s.upcase
14
18
  builder.DTPOSTED transaction.date_posted.strftime("%Y%m%d%H%M%S")
@@ -21,8 +25,6 @@ module OFX
21
25
  end
22
26
  end
23
27
  end
24
-
25
- register Banking::Transaction, :"banking.statement_transaction"
26
28
  end
27
29
  end
28
30
  end
@@ -1,9 +1,37 @@
1
+ require "ofx/data/serialization/registry"
2
+
1
3
  module OFX
2
4
  module Data
3
5
  module Serialization
4
6
  module Common
7
+ module ClassMethods
8
+ def register_with(registry)
9
+ serializer = new(registry)
10
+ registry.register(serializer.registry_entry)
11
+ end
12
+ end
13
+
14
+ def self.included(base)
15
+ base.extend ClassMethods
16
+ base.class_eval do
17
+ attr_reader :registry
18
+ end
19
+ end
20
+
21
+ def initialize(registry)
22
+ @registry = registry
23
+ end
24
+
25
+ def default_registry_entry_args
26
+ raise NotImplementedError, "must be implemented in includer"
27
+ end
28
+
29
+ def registry_entry
30
+ Registry::Entry.new(self, *default_registry_entry_args)
31
+ end
32
+
5
33
  def serialize_object(object, builder)
6
- registry.serializer_for(object).serialize(object, builder)
34
+ registry.serializer_for(object.ofx_type).serialize(object, builder)
7
35
  end
8
36
 
9
37
  def serialize_collection(collection, builder)
@@ -11,10 +39,6 @@ module OFX
11
39
  serialize_object(object, builder)
12
40
  end
13
41
  end
14
-
15
- def registry
16
- OFX::Data::Serialization.registry
17
- end
18
42
  end
19
43
  end
20
44
  end
@@ -5,9 +5,28 @@ module OFX
5
5
  module Data
6
6
  module Serialization
7
7
  class Document
8
- extend Common
8
+ include Common
9
9
 
10
- def self.serialize(document, builder)
10
+ def self.register_with(registry)
11
+ serializer = new(registry)
12
+ registry.register(serializer.registry_entry)
13
+ end
14
+
15
+ attr_reader :registry
16
+
17
+ def initialize(registry)
18
+ @registry = registry
19
+ end
20
+
21
+ def default_registry_entry_args
22
+ [:document, nil]
23
+ end
24
+
25
+ def registry_entry
26
+ Registry::Entry.new(self, *default_registry_entry_args)
27
+ end
28
+
29
+ def serialize(document, builder)
11
30
  decl = document.declaration
12
31
  builder.instruct!
13
32
  builder.instruct!(:OFX, {
@@ -18,12 +37,10 @@ module OFX
18
37
  NEWFILEUID: decl.newfileuid
19
38
  })
20
39
  builder.OFX do |builder|
21
- MessageSet.serialize(document.message_sets, builder)
40
+ serialize_object(document.message_sets, builder)
22
41
  end
23
42
  end
24
43
  end
25
-
26
- register(Document, :document)
27
44
  end
28
45
  end
29
46
  end
@@ -0,0 +1,21 @@
1
+ require "ofx/data/serialization/common"
2
+ require "ofx/data/serialization/message_sets/banking"
3
+ require "ofx/data/serialization/message_sets/signon"
4
+
5
+ module OFX
6
+ module Data
7
+ module Serialization
8
+ class MessageSets
9
+ include Common
10
+
11
+ def default_registry_entry_args
12
+ [:message_sets, nil]
13
+ end
14
+
15
+ def serialize(message_sets, builder)
16
+ serialize_collection(message_sets, builder)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -4,15 +4,19 @@ require "ofx/data/serialization/common"
4
4
  module OFX
5
5
  module Data
6
6
  module Serialization
7
- module MessageSet
7
+ class MessageSets
8
8
  module Banking
9
9
  class Request
10
10
  end
11
11
 
12
12
  class Response
13
- extend Serialization::Common
13
+ include Serialization::Common
14
14
 
15
- def self.serialize(message_set, builder)
15
+ def default_registry_entry_args
16
+ [:"message_sets.banking.response", nil]
17
+ end
18
+
19
+ def serialize(message_set, builder)
16
20
  builder.BANKMSGSRSV1 do |builder|
17
21
  serialize_collection(message_set.messages, builder)
18
22
  end
@@ -20,8 +24,6 @@ module OFX
20
24
  end
21
25
  end
22
26
  end
23
-
24
- register MessageSet::Banking::Response, :"message_sets.banking.response"
25
27
  end
26
28
  end
27
29
  end
@@ -0,0 +1,29 @@
1
+ require "ofx/data/serialization"
2
+ require "ofx/data/serialization/common"
3
+
4
+ module OFX
5
+ module Data
6
+ module Serialization
7
+ class MessageSets
8
+ module Signon
9
+ class Request
10
+ end
11
+
12
+ class Response
13
+ include Serialization::Common
14
+
15
+ def default_registry_entry_args
16
+ [:"message_sets.signon.response", nil]
17
+ end
18
+
19
+ def serialize(message, builder)
20
+ builder.SIGNONMSGSRSV1 do |builder|
21
+ serialize_object(message.message, builder)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,37 @@
1
+ require "builder"
2
+ require "ofx/data/serialization/registry"
3
+ require "ofx/data/serialization"
4
+
5
+ module OFX
6
+ module Data
7
+ module Serialization
8
+ module OFX203
9
+ SERIALIZER_CLASSES = [
10
+ Document, Transaction::Status,
11
+ MessageSets, MessageSets::Banking,
12
+ Banking::Balance, Banking::BankAccount,
13
+ Banking::Transaction, Banking::Statement::Response,
14
+ Banking::Statement::Transaction
15
+ ]
16
+
17
+ def self.registry
18
+ Registry.build { |r|
19
+ SERIALIZER_CLASSES.each do |klass|
20
+ klass.register_with(r)
21
+ end
22
+ }
23
+ end
24
+
25
+ def self.builder
26
+ Builder::XmlMarkup.new
27
+ end
28
+
29
+ def self.serialize(object)
30
+ output = builder
31
+ registry.serializer_for(object.ofx_type).serialize(object, output)
32
+ output.target!
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,30 +1,42 @@
1
+ require "ofx/data/serialization/registry/entry"
2
+
1
3
  module OFX
2
4
  module Data
3
5
  module Serialization
4
6
  class Registry
5
- def initialize
6
- @registry = {}
7
+ def self.build(&block)
8
+ registry = new
9
+ block.call(registry)
10
+ registry
7
11
  end
8
12
 
9
- def register(serialization_class, ofx_type)
10
- @registry[ofx_type] = serialization_class
13
+ attr_reader :entries
14
+
15
+ def initialize
16
+ @entries = []
11
17
  end
12
18
 
13
- def serializer_for(data_instance)
14
- @registry.fetch(data_instance.ofx_type)
19
+ def register(entry)
20
+ entries << entry
15
21
  end
16
22
 
17
- def registered_for(serialization_class)
18
- @registry.find(->() { [] }) { |ofx_type, klass| klass == serialization_class }.first
23
+ def matching_entry(ofx_type, context_name)
24
+ match = entries.find { |entry| entry.match?(ofx_type, context_name) }
25
+ raise SerializerNotFoundError.generate(ofx_type, context_name) if match.nil?
26
+ match
19
27
  end
20
- end
21
28
 
22
- def self.registry
23
- @registry ||= OFX::Data::Serialization::Registry.new
29
+ def serializer_for(ofx_type, context_name = nil)
30
+ matching_entry(ofx_type, context_name).serializer
31
+ end
24
32
  end
25
33
 
26
- def self.register(*args)
27
- registry.register(*args)
34
+ class SerializerNotFoundError < StandardError
35
+ def self.generate(ofx_type, context_name)
36
+ message = "Cannot find serializer for OFX type #{ofx_type.inspect}"
37
+ message << " with context name #{context_name.inspect}" if context_name
38
+ new(message)
39
+ end
28
40
  end
29
41
  end
30
42
  end
@@ -0,0 +1,21 @@
1
+ module OFX
2
+ module Data
3
+ module Serialization
4
+ class Registry
5
+ class Entry
6
+ attr_reader :serializer, :ofx_type, :context_name
7
+
8
+ def initialize(serializer, ofx_type, context_name = nil)
9
+ @serializer = serializer
10
+ @ofx_type = ofx_type
11
+ @context_name = context_name
12
+ end
13
+
14
+ def match?(ofx_type, context_name = nil)
15
+ self.ofx_type == ofx_type && self.context_name == context_name
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ require "ofx/data/serialization/common"
2
+
3
+ module OFX
4
+ module Data
5
+ module Serialization
6
+ module Signon
7
+ class Response
8
+ include Serialization::Common
9
+
10
+ def default_registry_entry_args
11
+ [:"signon.response", nil]
12
+ end
13
+
14
+ def serialize(response, builder)
15
+ builder.SONRS do |builder|
16
+ serialize_object(response.status, builder)
17
+ builder.DTSERVER response.dtserver.strftime("%Y%m%d%H%M%S")
18
+ builder.LANGUAGE response.language.to_s.upcase
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -6,9 +6,13 @@ module OFX
6
6
  module Serialization
7
7
  module Transaction
8
8
  class Status
9
- extend Serialization::Common
9
+ include Serialization::Common
10
10
 
11
- def self.serialize(status, builder)
11
+ def default_registry_entry_args
12
+ [:"transaction.status", nil]
13
+ end
14
+
15
+ def serialize(status, builder)
12
16
  builder.STATUS do |builder|
13
17
  builder.CODE status.code
14
18
  builder.SEVERITY status.severity.to_s.upcase
@@ -19,8 +23,6 @@ module OFX
19
23
  end
20
24
  end
21
25
  end
22
-
23
- register Transaction::Status, :"transaction.status"
24
26
  end
25
27
  end
26
28
  end
@@ -0,0 +1 @@
1
+ require "ofx/data/signon/response"
@@ -0,0 +1,19 @@
1
+ module OFX
2
+ module Data
3
+ module Signon
4
+ class Response
5
+ attr_reader :status, :dtserver, :language
6
+
7
+ def initialize(opts)
8
+ @status = opts.fetch(:status)
9
+ @dtserver = opts.fetch(:dtserver)
10
+ @language = opts.fetch(:language)
11
+ end
12
+
13
+ def ofx_type
14
+ :"signon.response"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  module OFX
2
2
  module Data
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ofx-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Patterson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-28 00:00:00.000000000 Z
11
+ date: 2016-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.12'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.6'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.6'
83
83
  description: |
@@ -90,8 +90,8 @@ executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
- - .gitignore
94
- - .rspec
93
+ - ".gitignore"
94
+ - ".rspec"
95
95
  - CODE_OF_CONDUCT.md
96
96
  - Gemfile
97
97
  - LICENSE.txt
@@ -110,9 +110,9 @@ files:
110
110
  - lib/ofx/data/banking/transaction.rb
111
111
  - lib/ofx/data/declaration.rb
112
112
  - lib/ofx/data/document.rb
113
- - lib/ofx/data/message_set.rb
114
- - lib/ofx/data/message_set/banking.rb
115
- - lib/ofx/data/message_set/signon.rb
113
+ - lib/ofx/data/message_sets.rb
114
+ - lib/ofx/data/message_sets/banking.rb
115
+ - lib/ofx/data/message_sets/signon.rb
116
116
  - lib/ofx/data/objects.rb
117
117
  - lib/ofx/data/serialization.rb
118
118
  - lib/ofx/data/serialization/banking.rb
@@ -124,10 +124,16 @@ files:
124
124
  - lib/ofx/data/serialization/banking/transaction.rb
125
125
  - lib/ofx/data/serialization/common.rb
126
126
  - lib/ofx/data/serialization/document.rb
127
- - lib/ofx/data/serialization/message_set.rb
128
- - lib/ofx/data/serialization/message_set/banking.rb
127
+ - lib/ofx/data/serialization/message_sets.rb
128
+ - lib/ofx/data/serialization/message_sets/banking.rb
129
+ - lib/ofx/data/serialization/message_sets/signon.rb
130
+ - lib/ofx/data/serialization/ofx203.rb
129
131
  - lib/ofx/data/serialization/registry.rb
132
+ - lib/ofx/data/serialization/registry/entry.rb
133
+ - lib/ofx/data/serialization/signon/response.rb
130
134
  - lib/ofx/data/serialization/transaction/status.rb
135
+ - lib/ofx/data/signon.rb
136
+ - lib/ofx/data/signon/response.rb
131
137
  - lib/ofx/data/transaction/status.rb
132
138
  - lib/ofx/data/version.rb
133
139
  - ofx-data.gemspec
@@ -141,17 +147,17 @@ require_paths:
141
147
  - lib
142
148
  required_ruby_version: !ruby/object:Gem::Requirement
143
149
  requirements:
144
- - - '>='
150
+ - - ">="
145
151
  - !ruby/object:Gem::Version
146
152
  version: '0'
147
153
  required_rubygems_version: !ruby/object:Gem::Requirement
148
154
  requirements:
149
- - - '>='
155
+ - - ">="
150
156
  - !ruby/object:Gem::Version
151
157
  version: '0'
152
158
  requirements: []
153
159
  rubyforge_project:
154
- rubygems_version: 2.0.14.1
160
+ rubygems_version: 2.5.1
155
161
  signing_key:
156
162
  specification_version: 4
157
163
  summary: Generate OFX XML documents
@@ -1,2 +0,0 @@
1
- require "ofx/data/message_set/signon"
2
- require "ofx/data/message_set/banking"
@@ -1,32 +0,0 @@
1
- require "ofx/data/serialization"
2
- require "ofx/data/serialization/common"
3
- require "ofx/data/serialization/message_set/banking"
4
-
5
- module OFX
6
- module Data
7
- module Serialization
8
- module MessageSet
9
- extend Common
10
-
11
- ORDER = [
12
- :signon, :signup, :banking, :credit_card_statements,
13
- :investment_statements, :interbank_funds_transfers,
14
- :wire_funds_transfers, :payments, :general_email,
15
- :investment_security_list, :biller_directory,
16
- :bill_delivery, :fi_profile
17
- ]
18
- ORDER_LOOKUP = Hash[ORDER.each_with_index.map { |k, v| [k, v] }]
19
-
20
- def self.order_sets(message_sets)
21
- message_sets.sort_by { |set| ORDER_LOOKUP[set.message_set_type] }
22
- end
23
-
24
- def self.serialize(message_sets, builder)
25
- serialize_collection(order_sets(message_sets), builder)
26
- end
27
- end
28
-
29
- register(MessageSet, :message_sets)
30
- end
31
- end
32
- end