class AvroTurf::MutableSchemaStore

A schema store that allows you to add or remove schemas, and to access them externally.

Attributes

schemas[RW]

Public Instance Methods

add_schema(schema_hash) click to toggle source

@param schema_hash [Hash]

# File lib/avro_turf/mutable_schema_store.rb, line 10
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