Class: Avro::Builder::Types::BytesType
- Defined in:
- lib/avro/builder/types/bytes_type.rb
Overview
Subclass for the primitive Bytes type because it supports the decimal logical type.
Instance Attribute Summary
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(cache:, field: nil) ⇒ BytesType
constructor
A new instance of BytesType.
- #serialize(reference_state) ⇒ Object
- #to_h(reference_state) ⇒ Object
Methods inherited from Type
#abstract?, #cache!, #configure_options, #dsl_method?, #dsl_respond_to?, #namespace, union_with_null, #validate!
Methods included from DslAttributes
Methods included from DslOptions
Constructor Details
#initialize(cache:, field: nil) ⇒ BytesType
Returns a new instance of BytesType.
10 11 12 |
# File 'lib/avro/builder/types/bytes_type.rb', line 10 def initialize(cache:, field: nil) super('bytes', field: field, cache: cache) end |
Instance Method Details
#serialize(reference_state) ⇒ Object
14 15 16 |
# File 'lib/avro/builder/types/bytes_type.rb', line 14 def serialize(reference_state) super(reference_state, overrides: serialized_attributes) end |
#to_h(reference_state) ⇒ Object
18 19 20 |
# File 'lib/avro/builder/types/bytes_type.rb', line 18 def to_h(reference_state) super(reference_state, overrides: serialized_attributes) end |