Class: ThreadVariables::AccessProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/thread_variables/access.rb

Instance Method Summary collapse

Constructor Details

#initialize(thread) ⇒ AccessProxy

Returns a new instance of AccessProxy.



5
6
7
# File 'lib/thread_variables/access.rb', line 5

def initialize(thread)
  @thread = thread
end

Instance Method Details

#[](k) ⇒ Object



9
10
11
# File 'lib/thread_variables/access.rb', line 9

def [](k)
  @thread.thread_variable_get(k)
end

#[]=(k, v) ⇒ Object



13
14
15
# File 'lib/thread_variables/access.rb', line 13

def []=(k,v)
  @thread.thread_variable_set(k,v)
end

#key?(k) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/thread_variables/access.rb', line 17

def key?(k)
  @thread.thread_variable?(k)
end

#keysObject



21
22
23
# File 'lib/thread_variables/access.rb', line 21

def keys
  @thread.thread_variables
end