Sha256: 7dacac2fd6c91142872d4e511d9d4dcb98297f47c96ef2e2e5d71c2bfd37d188

Contents?: true

Size: 526 Bytes

Versions: 24

Compression:

Stored size: 526 Bytes

Contents

require 'avro_turf/schema_store'

class AvroTurf
  # A schema store that allows you to add or remove schemas, and to access
  # them externally.
  class MutableSchemaStore < SchemaStore
    attr_accessor :schemas

    # @param schema_hash [Hash]
    def add_schema(schema_hash)
      name = schema_hash['name']
      namespace = schema_hash['namespace']
      full_name = Avro::Name.make_fullname(name, namespace)
      return if @schemas.key?(full_name)
      Avro::Schema.real_parse(schema_hash, @schemas)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
avro_turf-1.17.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.16.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.15.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.14.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.13.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.12.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.11.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.10.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.9.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.8.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.7.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.6.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.5.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.4.1 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.4.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.3.1 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.3.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.2.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.1.0 lib/avro_turf/mutable_schema_store.rb
avro_turf-1.0.0 lib/avro_turf/mutable_schema_store.rb