Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Thread#[]=

thr[sym] = obj → obj

Attribute Assignment—Sets or creates the value of a fiber-local variable, using either a symbol or a string.

See also Thread#[].

For thread-local variables, please see thread_variable_set and thread_variable_get.