class AWS::Flow::Core::FlowFiber
@api private
Attributes
local_variables[RW]
Public Class Methods
[](index)
click to toggle source
@api private
# File lib/aws/flow/fiber.rb, line 38 def self.[](index) self.local_variables[index] end
[]=(key, value)
click to toggle source
@api private
# File lib/aws/flow/fiber.rb, line 42 def self.[]=(key, value) self.local_variables[key] = value end
finalize(obj_id)
click to toggle source
@api private
# File lib/aws/flow/fiber.rb, line 34 def self.finalize(obj_id) proc { FlowFiber.local_variables.delete(obj_id) } end
new(*args)
click to toggle source
@api private
Calls superclass method
# File lib/aws/flow/fiber.rb, line 24 def initialize(*args) ObjectSpace.define_finalizer(self, self.class.finalize(self.object_id)) super(args) end
unset(current_fiber, key)
click to toggle source
Unsets all the values for ancestors of this fiber, assuming that they have the same value for key. That is, they will unset upwards until the first time the value stored at key is changed. @api private
# File lib/aws/flow/fiber.rb, line 50 def self.unset(current_fiber, key) current_value = FlowFiber[current_fiber.object_id][key] parent = FlowFiber[current_fiber.object_id][:parent] ancestor_fibers = [] while parent != nil ancestor_fibers << parent parent = FlowFiber[parent.object_id][:parent] end ancestor_fibers.each do |fiber| FlowFiber[fiber.object_id].delete(key) if FlowFiber[fiber.object_id][key] == current_value end FlowFiber[current_fiber.object_id].delete(key) end
Public Instance Methods
[](key)
click to toggle source
@api private
# File lib/aws/flow/fiber.rb, line 75 def [](key) FlowFiber[self.object_id][key] end
[]=(key, value)
click to toggle source
@api private
# File lib/aws/flow/fiber.rb, line 79 def []=(key, value) FlowFiber[self.object_id][key] = value end