Sha256: 0d88b6bd2154a37357ba5fa5d05babee7a50cafc38efd6957547eba29b738727

Contents?: true

Size: 563 Bytes

Versions: 2

Compression:

Stored size: 563 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 create_builtin_or_lookup_named_type(type_name)
          if builtin_type?(type_name)
            create_builtin_type(type_name)
          else
            builder.lookup_named_type(type_name)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
avro-builder-0.4.0 lib/avro/builder/types/type_referencer.rb
avro-builder-0.3.2 lib/avro/builder/types/type_referencer.rb