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.
26 27 28 29 30 |
# File 'lib/async/container/keyed.rb', line 26 def initialize(key, value) @key = key @value = value @marked = true end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
32 33 34 |
# File 'lib/async/container/keyed.rb', line 32 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
33 34 35 |
# File 'lib/async/container/keyed.rb', line 33 def value @value end |
Instance Method Details
#clear! ⇒ Object
43 44 45 |
# File 'lib/async/container/keyed.rb', line 43 def clear! @marked = false end |
#mark! ⇒ Object
39 40 41 |
# File 'lib/async/container/keyed.rb', line 39 def mark! @marked = true end |
#marked? ⇒ Boolean
35 36 37 |
# File 'lib/async/container/keyed.rb', line 35 def marked? @marked end |
#stop? ⇒ Boolean
47 48 49 50 51 52 |
# File 'lib/async/container/keyed.rb', line 47 def stop? unless @marked @value.stop return true end end |