Class: Solace::Serializers::BaseDeserializer
- Defined in:
- lib/solace/serializers/base_deserializer.rb
Overview
Base deserializer class
Direct Known Subclasses
AddressLookupTableDeserializer, InstructionDeserializer, MessageDeserializer, TransactionDeserializer
Class Attribute Summary collapse
-
.record_class ⇒ Class
The class of the record.
-
.RECORD_CLASS ⇒ Object
The class of the record being deserialized.
-
.STEPS ⇒ Object
An ordered list of methods to deserialize the record.
-
.steps ⇒ Array
The steps to deserialize the record.
Instance Attribute Summary collapse
-
#io ⇒ Object
The input to read bytes from.
- #record ⇒ IO or StringIO, Record
Instance Method Summary collapse
-
#call ⇒ Record
Deserializes the record.
-
#initialize(io) ⇒ BaseDeserializer
constructor
Initialize a new deserializer.
Methods inherited from Base
Constructor Details
#initialize(io) ⇒ BaseDeserializer
Initialize a new deserializer
42 43 44 45 |
# File 'lib/solace/serializers/base_deserializer.rb', line 42 def initialize(io) @io = io @record = self.class.record_class.new end |
Class Attribute Details
.record_class ⇒ Class
Returns The class of the record.
24 25 26 |
# File 'lib/solace/serializers/base_deserializer.rb', line 24 def record_class @record_class end |
.RECORD_CLASS ⇒ Object
The class of the record being deserialized
24 |
# File 'lib/solace/serializers/base_deserializer.rb', line 24 attr_accessor :record_class |
.STEPS ⇒ Object
An ordered list of methods to deserialize the record
18 |
# File 'lib/solace/serializers/base_deserializer.rb', line 18 attr_accessor :steps |
.steps ⇒ Array
Returns The steps to deserialize the record.
18 19 20 |
# File 'lib/solace/serializers/base_deserializer.rb', line 18 def steps @steps end |
Instance Attribute Details
#io ⇒ Object
The input to read bytes from.
36 37 38 |
# File 'lib/solace/serializers/base_deserializer.rb', line 36 def io @io end |
#record ⇒ IO or StringIO, Record
36 |
# File 'lib/solace/serializers/base_deserializer.rb', line 36 attr_reader :io, :record |
Instance Method Details
#call ⇒ Record
Deserializes the record
50 51 52 53 |
# File 'lib/solace/serializers/base_deserializer.rb', line 50 def call self.class.steps.each { send(_1) } record end |