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.



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

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

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

Returns:

  • (Boolean)


35
36
37
# File 'lib/async/container/keyed.rb', line 35

def marked?
	@marked
end

#stop?Boolean

Returns:

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