Class: Tep::FiberSlot

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

Overview

Helper: spinel won’t infer types on an empty ‘{}`, so we seed with one entry then delete it. Used by Request/Response so users get the natural Hash[] / Hash[]= surface (Sinatra-style `params` works without a bespoke Bag wrapper). Holder for a Fiber so we can keep them in a typed array. Spinel’s ‘[Fiber.new { … }]` array literal infers IntArray (Fiber is a built-in pointer type, not a user class spinel tracks via PtrArray), so a one-attribute wrapper class is the cheapest way to put them in a homogeneous container.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(f) ⇒ FiberSlot

Returns a new instance of FiberSlot.



104
105
106
# File 'lib/tep.rb', line 104

def initialize(f)
  @f = f
end

Instance Attribute Details

#fObject

Returns the value of attribute f.



103
104
105
# File 'lib/tep.rb', line 103

def f
  @f
end