Class: Plumb::Deferred
- Inherits:
-
Object
- Object
- Plumb::Deferred
- Includes:
- Composable
- Defined in:
- lib/plumb/deferred.rb
Instance Method Summary collapse
- #call(result) ⇒ Object
-
#initialize(definition) ⇒ Deferred
constructor
A new instance of Deferred.
Methods included from Composable
#>>, #[], #as_node, #build, #check, #children, #defer, #generate, included, #invalid, #invoke, #match, #metadata, #not, #pipeline, #policy, #static, #to_json_schema, #to_s, #transform, #value, wrap, #|
Methods included from Callable
Constructor Details
#initialize(definition) ⇒ Deferred
Returns a new instance of Deferred.
9 10 11 12 13 14 |
# File 'lib/plumb/deferred.rb', line 9 def initialize(definition) @lock = Mutex.new @definition = definition @cached_type = nil # freeze end |
Instance Method Details
#call(result) ⇒ Object
16 17 18 |
# File 'lib/plumb/deferred.rb', line 16 def call(result) cached_type.call(result) end |