Class: Command::Results::ListIterator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/command-set/result-list.rb

Overview

Basically an Enumerator over a List. Give it any list element, and each will take you to the end of the list.

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ ListIterator

Returns a new instance of ListIterator.



287
288
289
# File 'lib/command-set/result-list.rb', line 287

def initialize(list)
  @list = list
end

Instance Method Details

#eachObject



291
292
293
294
295
296
297
# File 'lib/command-set/result-list.rb', line 291

def each
  thumb = @list
  until thumb.nil?
    yield thumb
    thumb = thumb.tree_order_next
  end
end