Class | REXML::SyncEnumerator |
In: |
lib/rexml/syncenumerator.rb
|
Parent: | Object |
Creates a new SyncEnumerator which enumerates rows of given Enumerable objects.
# File lib/rexml/syncenumerator.rb, line 7 7: def initialize(*enums) 8: @gens = enums 9: @biggest = @gens[0] 10: @gens.each {|x| @biggest = x if x.size > @biggest.size } 11: end
Enumerates rows of the Enumerable objects.
# File lib/rexml/syncenumerator.rb, line 26 26: def each 27: @biggest.zip( *@gens ) {|a| 28: yield(*a[1..-1]) 29: } 30: self 31: end
Returns the number of enumerated Enumerable objects, i.e. the size of each row.
# File lib/rexml/syncenumerator.rb, line 21 21: def length 22: @gens.length 23: end
Returns the number of enumerated Enumerable objects, i.e. the size of each row.
# File lib/rexml/syncenumerator.rb, line 15 15: def size 16: @gens.size 17: end