Class: Fiber

Inherits:
Object
  • Object
show all
Defined in:
lib/green/ext.rb

Instance Method Summary collapse

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.



10
11
12
# File 'lib/green/ext.rb', line 10

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#[].



16
17
18
# File 'lib/green/ext.rb', line 16

def []=(key,value)
  local_fiber_variables[key] = value
end

#local_fiber_variablesObject



20
21
22
# File 'lib/green/ext.rb', line 20

def local_fiber_variables
  @local_fiber_variables ||= {}
end