Class: Avro::Builder::Types::BytesType

Inherits:
Type
  • Object
show all
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

#avro_type_name

Instance Method Summary collapse

Methods inherited from Type

#abstract?, #cache!, #configure_options, #dsl_method?, #dsl_respond_to?, #namespace, union_with_null, #validate!

Methods included from DslAttributes

#dsl_attribute?, included

Methods included from DslOptions

#dsl_option?, included

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