Class: OFX::OFX200::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/2.0.0/serializer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.xml_ofx?(body) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/ofx/2.0.0/serializer.rb', line 7

def self.xml_ofx?(body)
    OFX::OFX200::XMLParser.xml_ofx?(body)
end

Instance Method Details

#from_http_response_body(body) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/ofx/2.0.0/serializer.rb', line 11

def from_http_response_body(body)
    body = body.to_s.lstrip
    unless self.class.xml_ofx?(body)
        raise NotImplementedError, 'OFX 2.x serializer only supports XML OFX documents'
    end

    OFX::OFX200::XMLParser.new(body).to_document
end

#to_http_post_body(document) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/ofx/2.0.0/serializer.rb', line 20

def to_http_post_body(document)
    raise NotImplementedError
end