Class: Synapse::Configuration::SerializerDefinitionBuilder
- Inherits:
-
DefinitionBuilder
- Object
- DefinitionBuilder
- Synapse::Configuration::SerializerDefinitionBuilder
- Defined in:
- lib/synapse/configuration/component/serialization/serializer.rb
Overview
Definition builder used to create and configure serializers
Instance Attribute Summary
Attributes inherited from DefinitionBuilder
Instance Method Summary collapse
-
#use_attribute ⇒ undefined
Selects a serializer that uses attributes (ActiveModel, Virtus, etc.).
-
#use_converter_factory(converter_factory) ⇒ undefined
Changes the converter factory.
-
#use_deserialize_options(deserialize_options) ⇒ undefined
Changes the options to use during deserialization; note that these are serializer-specific and that not all serializers support options.
-
#use_marshal ⇒ undefined
Selects a serializer that uses the Ruby marshaling library.
-
#use_oj ⇒ undefined
Selects a serializer that uses the Optimized JSON (Oj) serialization library.
-
#use_ox ⇒ undefined
Selects a serializer that uses the Optimized XML (Ox) serialization library.
-
#use_serialize_options(serialize_options) ⇒ undefined
Changes the options to use during serialization; note that these are serializer-specific and that not all serializers support options.
Methods inherited from DefinitionBuilder
#anonymous, #as_prototype, #as_singleton, build, #build_composite, #build_definition, #clear_tags, #identified_by, #initialize, #register_definition, #replace_tags, #tag, #use_factory, #use_instance
Constructor Details
This class inherits a constructor from Synapse::Configuration::DefinitionBuilder
Instance Method Details
#use_attribute ⇒ undefined
Selects a serializer that uses attributes (ActiveModel, Virtus, etc.)
18 19 20 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 18 def use_attribute @serializer_type = Serialization::AttributeSerializer end |
#use_converter_factory(converter_factory) ⇒ undefined
Changes the converter factory
51 52 53 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 51 def use_converter_factory(converter_factory) @converter_factory = converter_factory end |
#use_deserialize_options(deserialize_options) ⇒ undefined
Changes the options to use during deserialization; note that these are serializer-specific and that not all serializers support options.
69 70 71 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 69 def () @deserialize_options = end |
#use_marshal ⇒ undefined
Selects a serializer that uses the Ruby marshaling library
26 27 28 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 26 def use_marshal @serializer_type = Serialization::MarshalSerializer end |
#use_oj ⇒ undefined
Selects a serializer that uses the Optimized JSON (Oj) serialization library
34 35 36 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 34 def use_oj @serializer_type = Serialization::OjSerializer end |
#use_ox ⇒ undefined
Selects a serializer that uses the Optimized XML (Ox) serialization library
42 43 44 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 42 def use_ox @serializer_type = Serialization::OxSerializer end |
#use_serialize_options(serialize_options) ⇒ undefined
Changes the options to use during serialization; note that these are serializer-specific and that not all serializers support options.
60 61 62 |
# File 'lib/synapse/configuration/component/serialization/serializer.rb', line 60 def () @serialize_options = end |