Sha256: 5e93ac898bacbfa16bcb3bde8aa0b7d6a385451d46f56ad5268577923213d599
Contents?: true
Size: 671 Bytes
Versions: 21
Compression:
Stored size: 671 Bytes
Contents
module Avro module Builder # This class is used to keep track of references to each named type while # generating an Avro JSON schema. Only the first reference to the type # can include all of details of the definition. All subsequent references # must use the full name for the type. class SchemaSerializerReferenceState attr_reader :references private :references def initialize @references = Set.new end def definition_or_reference(fullname) if references.include?(fullname) fullname else references << fullname yield end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems