Module: Avromatic::Model::RawSerialization::ClassMethods
- Includes:
- Decode
- Defined in:
- lib/avromatic/model/raw_serialization.rb
Instance Method Summary collapse
- #datum_reader ⇒ Object
- #datum_reader_class ⇒ Object
- #datum_writer ⇒ Object
- #datum_writer_class ⇒ Object
Methods included from Decode
Instance Method Details
#datum_reader ⇒ Object
162 163 164 165 166 167 168 |
# File 'lib/avromatic/model/raw_serialization.rb', line 162 def datum_reader @datum_reader ||= begin hash = { value: datum_reader_class.new(value_avro_schema) } hash[:key] = datum_reader_class.new(key_avro_schema) if key_avro_schema hash end end |
#datum_reader_class ⇒ Object
146 147 148 |
# File 'lib/avromatic/model/raw_serialization.rb', line 146 def datum_reader_class Avromatic.use_custom_datum_reader ? Avromatic::IO::DatumReader : Avro::IO::DatumReader end |
#datum_writer ⇒ Object
154 155 156 157 158 159 160 |
# File 'lib/avromatic/model/raw_serialization.rb', line 154 def datum_writer @datum_writer ||= begin hash = { value: datum_writer_class.new(value_avro_schema) } hash[:key] = datum_writer_class.new(key_avro_schema) if key_avro_schema hash end end |
#datum_writer_class ⇒ Object
150 151 152 |
# File 'lib/avromatic/model/raw_serialization.rb', line 150 def datum_writer_class Avromatic.use_custom_datum_writer ? Avromatic::IO::DatumWriter : Avro::IO::DatumWriter end |