Class | Stream::IntervalStream |
In: |
lib/stream.rb
|
Parent: | BasicStream |
A simple Iterator for iterating over a sequence of integers starting from zero up to a given upper bound. Mainly used by Stream::FilteredStream. Could be made private but if somebody needs it here it is. Is there a better name for it?
The upper bound is stored in the instance variable @stop which can be incremented dynamically by the method increment_stop.
pos | [R] |
Create a new IntervalStream with upper bound stop. stop - 1 is the last element. By default stop is zero which means that the stream is empty.