Class: Abroad::Serializers::Yaml::YamlSerializer

Inherits:
Serializer
  • Object
show all
Defined in:
lib/abroad/serializers/yaml/yaml_serializer.rb

Direct Known Subclasses

RailsSerializer

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 = {}) ⇒ YamlSerializer

Returns a new instance of YamlSerializer.


11
12
13
14
# File 'lib/abroad/serializers/yaml/yaml_serializer.rb', line 11

def initialize(stream, locale, options = {})
  super
  @writer = YamlWriteStream.from_stream(stream, encoding)
end

Instance Attribute Details

#writerObject (readonly)

Returns the value of attribute writer


9
10
11
# File 'lib/abroad/serializers/yaml/yaml_serializer.rb', line 9

def writer
  @writer
end