+(other)
click to toggle source
def +(other)
self.class.new(self, other)
end
each(&block)
click to toggle source
def each(&block)
return to_enum unless block
i = 0
while i < @enums.size
@pos = i
@enums[i].each(&block)
i += 1
end
self
end
inspect()
click to toggle source
def inspect
"#<#{self.class}: #{@enums.inspect}>"
end
rewind()
click to toggle source
def rewind
while 0 <= @pos && @pos < @enums.size
e = @enums[@pos]
e.rewind if e.respond_to?(:rewind)
@pos -= 1
end
self
end
size()
click to toggle source
def size
@enums.reduce(0) do |a, e|
return nil unless e.respond_to?(:size)
a + e.size
end
end