Class: Textus::Handlers::Maintenance::SchemaEnvelope
- Inherits:
-
Object
- Object
- Textus::Handlers::Maintenance::SchemaEnvelope
- Defined in:
- lib/textus/handlers/maintenance/schema_envelope.rb
Instance Method Summary collapse
- #call(command, _call) ⇒ Object
-
#initialize(manifest:, schemas:) ⇒ SchemaEnvelope
constructor
A new instance of SchemaEnvelope.
Constructor Details
#initialize(manifest:, schemas:) ⇒ SchemaEnvelope
Returns a new instance of SchemaEnvelope.
5 6 7 8 |
# File 'lib/textus/handlers/maintenance/schema_envelope.rb', line 5 def initialize(manifest:, schemas:) @manifest = manifest @schemas = schemas end |
Instance Method Details
#call(command, _call) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/textus/handlers/maintenance/schema_envelope.rb', line 10 def call(command, _call) mentry = @manifest.resolver.resolve(command.key).entry schema = @schemas.fetch_or_nil(mentry.schema) Value::Result.success("protocol" => Textus::PROTOCOL, "key" => command.key, "schema_ref" => mentry.schema, "schema" => schema&.to_h) end |