Class: Plumb::Deferred

Inherits:
Object
  • Object
show all
Includes:
Composable
Defined in:
lib/plumb/deferred.rb

Instance Method Summary collapse

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

#parse, #resolve

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