Class: Ramaze::Fiber

Inherits:
Fiber show all
Defined in:
lib/ramaze/snippets/ramaze/fiber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Fiber

Returns a new instance of Fiber.



5
6
7
8
# File 'lib/ramaze/snippets/ramaze/fiber.rb', line 5

def initialize(*args)
  super
  @state = {}
end

Instance Attribute Details

#stateObject

Returns the value of attribute state.



3
4
5
# File 'lib/ramaze/snippets/ramaze/fiber.rb', line 3

def state
  @state
end

Instance Method Details

#[](key) ⇒ Object



12
13
14
# File 'lib/ramaze/snippets/ramaze/fiber.rb', line 12

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

#[]=(key, value) ⇒ Object



16
17
18
# File 'lib/ramaze/snippets/ramaze/fiber.rb', line 16

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

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ramaze/snippets/ramaze/fiber.rb', line 20

def key?(key)
  @state.key?(key)
end