Class
Class Methods
::
lib/rexml/syncenumerator.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/rexml/syncenumerator.rb, line 8
def initialize(*enums)
@gens = enums
@length = @gens.collect {|x| x.size }.max
end
Creates a new SyncEnumerator
which enumerates rows of given Enumerable
objects.
Instance Methods
lib/rexml/syncenumerator.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/rexml/syncenumerator.rb, line 26
def each
@length.times {|i|
yield @gens.collect {|x| x[i]}
}
self
end
Enumerates rows of the Enumerable
objects.
#
lib/rexml/syncenumerator.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/rexml/syncenumerator.rb, line 21
def length
@gens.length
end
Returns the number of enumerated Enumerable
objects, i.e. the size of each row.
#
lib/rexml/syncenumerator.rb
View on GitHub
# File tmp/rubies/ruby-2.6.10/lib/rexml/syncenumerator.rb, line 15
def size
@gens.size
end
Returns the number of enumerated Enumerable
objects, i.e. the size of each row.