Sha256: c604c3242e648f09a4096e31d35c700d7503c8c83e647005b4ce66bc586522d3

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

require 'avro/builder/type_factory'

module Avro
  module Builder
    module Types

      # This concern is used by Types that reference other types.
      module TypeReferencer
        include Avro::Builder::TypeFactory

        def builder
          (!field.nil? && field.builder) || super
        end

        def find_or_create_type(type_name)
          builder.lookup(type_name, required: false) || create_type(type_name)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
avro-builder-0.3.1 lib/avro/builder/types/type_referencer.rb
avro-builder-0.3.0 lib/avro/builder/types/type_referencer.rb
avro-builder-0.2.0 lib/avro/builder/types/type_referencer.rb
avro-builder-0.1.0 lib/avro/builder/types/type_referencer.rb