Method: Tins::ThreadGlobal#instance_thread_global

Defined in:
lib/tins/dslkit.rb

#instance_thread_global(name, value = nil) ⇒ Object

Define a thread global variable for the current instance with name name. If the value value is given, it is used to initialize the variable.



89
90
91
92
93
94
95
96
# File 'lib/tins/dslkit.rb', line 89

def instance_thread_global(name, value = nil)
  sc = class << self
    extend Tins::ThreadGlobal
    self
  end
  sc.thread_global name, value
  self
end