Sha256: 5a9cb1161117619b536e198f7905bf7ee278f8f996ac15a8250631bf49d4f794

Contents?: true

Size: 410 Bytes

Versions: 40

Compression:

Stored size: 410 Bytes

Contents

module Ramaze
  class Fiber < ::Fiber
    # initialize isn't being called, so we have to hook into ::new
    def self.new(*args)
      instance = super
      instance.state = {}
      instance
    end

    attr_accessor :state

    def [](key)
      @state[key]
    end

    def []=(key, value)
      @state[key] = value
    end

    def key?(key)
      @state.key?(key)
    end
  end if defined?(::Fiber)
end

Version data entries

40 entries across 40 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.09 lib/ramaze/snippets/ramaze/fiber.rb
Pistos-ramaze-2008.12 lib/ramaze/snippets/ramaze/fiber.rb
Pistos-ramaze-2009.01 lib/ramaze/snippets/ramaze/fiber.rb
Pistos-ramaze-2009.04.08 lib/ramaze/snippets/ramaze/fiber.rb
Pistos-ramaze-2009.06.12 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2008.08 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2008.09 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2008.10 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2008.12 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.01 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.04.01 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.04.08 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.04.18 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.04.22 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.04 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.05.08 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.05 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.06.04 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.06.12 lib/ramaze/snippets/ramaze/fiber.rb
manveru-ramaze-2009.06 lib/ramaze/snippets/ramaze/fiber.rb