Class: Trenza::Parallel::MethodCall

Inherits:
Object
  • Object
show all
Includes:
BlankSlate
Defined in:
lib/trenza/parallel.rb

Instance Method Summary collapse

Methods included from BlankSlate

included

Constructor Details

#initialize(&block) ⇒ MethodCall

Returns a new instance of MethodCall.



18
19
20
# File 'lib/trenza/parallel.rb', line 18

def initialize(&block)
  @thread = Thread.new(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &blk) ⇒ Object



22
23
24
# File 'lib/trenza/parallel.rb', line 22

def method_missing(meth, *args, &blk)
  @thread.value.send(meth, *args, &blk).parallel
end