Class: Abroad::Serializers::Xml::XmlSerializer

Inherits:
Serializer
  • Object
show all
Defined in:
lib/abroad/serializers/xml/xml_serializer.rb

Direct Known Subclasses

AndroidSerializer

Constant Summary

Constants inherited from Serializer

Serializer::DEFAULT_ENCODING

Instance Attribute Summary collapse

Attributes inherited from Serializer

#locale, #options, #stream

Instance Method Summary collapse

Methods inherited from Serializer

#close, #encoding, #flush, from_stream, open, #write_key_value, #write_raw

Constructor Details

#initialize(stream, locale, options = {}) ⇒ XmlSerializer

Returns a new instance of XmlSerializer.


10
11
12
13
14
15
# File 'lib/abroad/serializers/xml/xml_serializer.rb', line 10

def initialize(stream, locale, options = {})
  super
  @writer = XmlWriteStream.from_stream(stream)
  writer.write_header(encoding: encoding.to_s)
  after_initialize
end

Instance Attribute Details

#writerObject (readonly)

Returns the value of attribute writer


8
9
10
# File 'lib/abroad/serializers/xml/xml_serializer.rb', line 8

def writer
  @writer
end

Instance Method Details

#after_initializeObject


17
18
# File 'lib/abroad/serializers/xml/xml_serializer.rb', line 17

def after_initialize
end