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(ctx:) ⇒ SchemaEnvelope

Returns a new instance of SchemaEnvelope.



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

def initialize(ctx:)
  @ctx = ctx
end

Instance Method Details

#call(key) ⇒ Object



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

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