Class: Async::Children

Inherits:
List
  • Object
show all
Defined in:
lib/async/node.rb

Instance Method Summary collapse

Constructor Details

#initializeChildren

Returns a new instance of Children.



121
122
123
124
125
# File 'lib/async/node.rb', line 121

def initialize
	super
	
	@transient_count = 0
end

Instance Method Details

#delete(item) ⇒ Object



140
141
142
143
144
145
146
# File 'lib/async/node.rb', line 140

def delete(item)
	if item.transient?
		@transient_count -= 1
	end
	
	super
end

#finished?Boolean

Returns:

  • (Boolean)


148
149
150
# File 'lib/async/node.rb', line 148

def finished?
	@size == @transient_count
end

#insert(item) ⇒ Object



132
133
134
135
136
137
138
# File 'lib/async/node.rb', line 132

def insert(item)
	if item.transient?
		@transient_count += 1
	end
	
	super
end

#transients?Boolean

Does this node have (direct) transient children?

Returns:

  • (Boolean)


128
129
130
# File 'lib/async/node.rb', line 128

def transients?
	@transient_count > 0
end