Class: Async::Container::Keyed
- Inherits:
-
Object
- Object
- Async::Container::Keyed
- Defined in:
- lib/async/container/keyed.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #clear! ⇒ Object
-
#initialize(key, value) ⇒ Keyed
constructor
A new instance of Keyed.
- #mark! ⇒ Object
- #marked? ⇒ Boolean
- #stop? ⇒ Boolean
Constructor Details
#initialize(key, value) ⇒ Keyed
Returns a new instance of Keyed.
24 25 26 27 28 |
# File 'lib/async/container/keyed.rb', line 24 def initialize(key, value) @key = key @value = value @marked = true end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
30 31 32 |
# File 'lib/async/container/keyed.rb', line 30 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
31 32 33 |
# File 'lib/async/container/keyed.rb', line 31 def value @value end |
Instance Method Details
#clear! ⇒ Object
41 42 43 |
# File 'lib/async/container/keyed.rb', line 41 def clear! @marked = false end |
#mark! ⇒ Object
37 38 39 |
# File 'lib/async/container/keyed.rb', line 37 def mark! @marked = true end |
#marked? ⇒ Boolean
33 34 35 |
# File 'lib/async/container/keyed.rb', line 33 def marked? @marked end |
#stop? ⇒ Boolean
45 46 47 48 49 50 |
# File 'lib/async/container/keyed.rb', line 45 def stop? unless @marked @value.stop return true end end |