thr[sym] â obj or nil
Instance Public methods
Attribute ReferenceâReturns the value of a fiber-local variable (current
thread's root fiber if not explicitely inside a Fiber), using either a symbol or a string name. If
the specified variable does not exist, returns nil.
[
Thread.new { Thread.current["name"] = "A" },
Thread.new { Thread.current[:name] = "B" },
Thread.new { Thread.current["name"] = "C" }
].each do |th|
th.join
puts "#{th.inspect}: #{th[:name]}"
end
prod