Class: Textus::Read::SchemaEnvelope
- Inherits:
-
Object
- Object
- Textus::Read::SchemaEnvelope
- Extended by:
- Contract::DSL
- Defined in:
- lib/textus/read/schema_envelope.rb
Instance Method Summary collapse
- #call(key) ⇒ Object
-
#initialize(container:, call: nil) ⇒ SchemaEnvelope
constructor
rubocop:disable Lint/UnusedMethodArgument.
Methods included from Contract::DSL
arg, around, cli, cli_stdin, contract, contract?, summary, surfaces, verb, view
Constructor Details
#initialize(container:, call: nil) ⇒ SchemaEnvelope
rubocop:disable Lint/UnusedMethodArgument
13 14 15 16 |
# File 'lib/textus/read/schema_envelope.rb', line 13 def initialize(container:, call: nil) # rubocop:disable Lint/UnusedMethodArgument @manifest = container.manifest @schemas = container.schemas end |
Instance Method Details
#call(key) ⇒ Object
18 19 20 21 22 |
# File 'lib/textus/read/schema_envelope.rb', line 18 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 |