Class: Fiber
- Inherits:
-
Object
- Object
- Fiber
- Defined in:
- lib/never_block/extensions/fiber_extensions.rb
Overview
If this file is meant to be used out of neverblock, then uncomment the following line require ‘fiber’
Instance Method Summary collapse
-
#[](key) ⇒ Object
Attribute Reference–Returns the value of a fiber-local variable, using either a symbol or a string name.
-
#[]=(key, value) ⇒ Object
Attribute Assignment–Sets or creates the value of a fiber-local variable, using either a symbol or a string.
Instance Method Details
#[](key) ⇒ Object
Attribute Reference–Returns the value of a fiber-local variable, using either a symbol or a string name. If the specified variable does not exist, returns nil.
14 15 16 |
# File 'lib/never_block/extensions/fiber_extensions.rb', line 14 def [](key) local_fiber_variables[key] end |
#[]=(key, value) ⇒ Object
Attribute Assignment–Sets or creates the value of a fiber-local variable, using either a symbol or a string. See also Fiber#[].
20 21 22 |
# File 'lib/never_block/extensions/fiber_extensions.rb', line 20 def []=(key,value) local_fiber_variables[key] = value end |