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.



125
126
127
128
129
# File 'lib/async/node.rb', line 125

def initialize
	super
	
	@transient_count = 0
end

Instance Method Details

#delete(item) ⇒ Object



144
145
146
147
148
149
150
# File 'lib/async/node.rb', line 144

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

#finished?Boolean

Returns:

  • (Boolean)


152
153
154
# File 'lib/async/node.rb', line 152

def finished?
	@size == @transient_count
end

#insert(item) ⇒ Object



136
137
138
139
140
141
142
# File 'lib/async/node.rb', line 136

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

#transients?Boolean

Does this node have (direct) transient children?

Returns:

  • (Boolean)


132
133
134
# File 'lib/async/node.rb', line 132

def transients?
	@transient_count > 0
end