Class: Bolt::Yarn
- Inherits:
-
Object
- Object
- Bolt::Yarn
- Defined in:
- lib/bolt/yarn.rb
Instance Attribute Summary collapse
-
#fiber ⇒ Object
readonly
Returns the value of attribute fiber.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize(fiber, index) ⇒ Yarn
constructor
A new instance of Yarn.
- #resume ⇒ Object
Constructor Details
#initialize(fiber, index) ⇒ Yarn
Returns a new instance of Yarn.
9 10 11 12 13 |
# File 'lib/bolt/yarn.rb', line 9 def initialize(fiber, index) @fiber = fiber @index = index @value = nil end |
Instance Attribute Details
#fiber ⇒ Object (readonly)
Returns the value of attribute fiber.
7 8 9 |
# File 'lib/bolt/yarn.rb', line 7 def fiber @fiber end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
7 8 9 |
# File 'lib/bolt/yarn.rb', line 7 def index @index end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/bolt/yarn.rb', line 7 def value @value end |
Instance Method Details
#alive? ⇒ Boolean
15 16 17 |
# File 'lib/bolt/yarn.rb', line 15 def alive? fiber.alive? end |
#resume ⇒ Object
19 20 21 |
# File 'lib/bolt/yarn.rb', line 19 def resume @value = fiber.resume end |