Class: Kobako::Extension::Backend
- Inherits:
-
Data
- Object
- Data
- Kobako::Extension::Backend
- Defined in:
- lib/kobako/extension.rb,
sig/kobako/extension.rbs
Overview
Kobako::Extension::Backend — the host attachment of an Extension,
pairing path (the constant path the backend binds at, single-segment
"File" or nested "MyApp::Store", spelling the guest constant the
idiom routes to) with provider (the source of the bound object).
A provider that is not itself callable is the bound object, resolved
once for the Sandbox's life; a callable provider is invoked once per
invocation to yield that invocation's object, so a fresh object backs
the path every invocation. Callability is the sole discriminator — a
fixed backend that is itself callable is supplied through a
non-callable wrapper. A callable provider that raises propagates its
exception to the invocation caller and leaves the guest unrun; the
next invocation resolves it afresh.
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
Returns the value of attribute path.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Class Method Summary collapse
Instance Attribute Details
#path ⇒ String (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'sig/kobako/extension.rbs', line 13 def path @path end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
14 15 16 |
# File 'sig/kobako/extension.rbs', line 14 def provider @provider end |
Class Method Details
.new(path:, provider:) ⇒ Kobako::Extension::Backend .new(path, provider) ⇒ Kobako::Extension::Backend
16 17 |
# File 'sig/kobako/extension.rbs', line 16
def self.new: (path: String, provider: untyped) -> Kobako::Extension::Backend
| (String path, untyped provider) -> Kobako::Extension::Backend
|