Class: Async::Container::Keyed

Inherits:
Object
  • Object
show all
Defined in:
lib/async/container/keyed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



30
31
32
# File 'lib/async/container/keyed.rb', line 30

def key
  @key
end

#valueObject (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

Returns:

  • (Boolean)


33
34
35
# File 'lib/async/container/keyed.rb', line 33

def marked?
	@marked
end

#stop?Boolean

Returns:

  • (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