Sha256: 40e7ce3c4fd99fa9f5d78ac138393e7694920943ac57b0576f18a3aa93ff52a4

Contents?: true

Size: 520 Bytes

Versions: 28

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

require 'avro_turf/schema_store'

# Allows us to add in-memory schemas to the schema store in
# addition to the ones stored in the file system.
class AvroTurf::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

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
deimos-ruby-1.0.0.pre.beta22 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta21 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta20 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta19 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta18 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta17 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta16 lib/deimos/monkey_patches/schema_store.rb
deimos-kafka-1.0.0.pre.beta15 lib/deimos/monkey_patches/schema_store.rb