Sha256: d927ade558b39761c92c59d07802ff8bab032d30ebfa266d467ba483bf380c14
Contents?: true
Size: 829 Bytes
Versions: 16
Compression:
Stored size: 829 Bytes
Contents
module Avro module Builder module Types class EnumType < NamedType dsl_attribute :doc dsl_attribute :symbols do |*values| # Define symbols explicitly to support values as a splat or single array if !values.empty? @symbols = values.flatten else @symbols end end def serialize(reference_state) super(reference_state, overrides: serialized_attributes) end def to_h(reference_state) super(reference_state, overrides: serialized_attributes) end def validate! super validate_required_attribute!(:symbols) end private def serialized_attributes { symbols: symbols, doc: doc } end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems