Module: OFX::Data::Serialization::OFX102

Defined in:
lib/ofx/data/serialization/ofx102.rb

Constant Summary collapse

SERIALIZER_CLASSES =
[
  Document::SGML, Transaction::Status,
  MessageSets, MessageSets::Banking::Response,
  MessageSets::Signon::Response, Signon::Response,
  Banking::Balance, Banking::BankAccount,
  Banking::Transaction, Banking::Statement::Response,
  Banking::Statement::Transaction::Response
]

Class Method Summary collapse

Class Method Details

.builderObject



26
27
28
# File 'lib/ofx/data/serialization/ofx102.rb', line 26

def self.builder
  Builder::XmlMarkup.new
end

.registryObject



18
19
20
21
22
23
24
# File 'lib/ofx/data/serialization/ofx102.rb', line 18

def self.registry
  Registry.build { |r|
    SERIALIZER_CLASSES.each do |klass|
      klass.register_with(r)
    end
  }
end

.serialize(object) ⇒ Object



30
31
32
33
34
# File 'lib/ofx/data/serialization/ofx102.rb', line 30

def self.serialize(object)
  output = builder
  registry.serializer_for(object.ofx_type).serialize(object, output)
  output.target!
end