Class: ThreadVariables::AccessProxy
- Inherits:
-
Object
- Object
- ThreadVariables::AccessProxy
- Defined in:
- lib/thread_variables/access.rb
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
-
#initialize(thread) ⇒ AccessProxy
constructor
A new instance of AccessProxy.
- #key?(k) ⇒ Boolean
- #keys ⇒ Object
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
17 18 19 |
# File 'lib/thread_variables/access.rb', line 17 def key?(k) @thread.thread_variable?(k) end |
#keys ⇒ Object
21 22 23 |
# File 'lib/thread_variables/access.rb', line 21 def keys @thread.thread_variables end |