Class: Trenza::Parallel::MethodCall
- Inherits:
-
Object
- Object
- Trenza::Parallel::MethodCall
- Includes:
- BlankSlate
- Defined in:
- lib/trenza/parallel.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ MethodCall
constructor
A new instance of MethodCall.
- #method_missing(meth, *args, &blk) ⇒ Object
Methods included from BlankSlate
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 |