Method: Async::List#first

Defined in:
lib/async/list.rb

#firstObject


196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/async/list.rb', line 196

def first
	# validate!
	
	current = @tail
	
	while !current.equal?(self)
		if current.is_a?(Iterator)
			current = current.tail
		else
			return current
		end
	end
	
	return nil
end