Class: Thread
Overview
Extensions for Thread
Class Method Summary collapse
-
.into(*args) ⇒ Object
Copy all thread variables into the new thread.
Class Method Details
.into(*args) ⇒ Object
Copy all thread variables into the new thread
9 10 11 12 13 14 15 16 17 |
# File 'lib/ramaze/snippets/thread/into.rb', line 9 def self.into *args Thread.new(Thread.current, *args) do |thread, *args| thread.keys.each do |k| Thread.current[k] = thread[k] unless k.to_s =~ /^__/ end yield(*args) end end |