Class: Textus::Application::Reads::SchemaEnvelope

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/application/reads/schema_envelope.rb

Instance Method Summary collapse

Constructor Details

#initialize(manifest:, schemas:) ⇒ SchemaEnvelope

Returns a new instance of SchemaEnvelope.



5
6
7
8
# File 'lib/textus/application/reads/schema_envelope.rb', line 5

def initialize(manifest:, schemas:)
  @manifest = manifest
  @schemas = schemas
end

Instance Method Details

#call(key) ⇒ Object



10
11
12
13
14
# File 'lib/textus/application/reads/schema_envelope.rb', line 10

def call(key)
  mentry = @manifest.resolver.resolve(key).entry
  schema = @schemas.fetch_or_nil(mentry.schema)
  { "protocol" => PROTOCOL, "key" => key, "schema_ref" => mentry.schema, "schema" => schema&.to_h }
end