Class: DStream::Zip
Instance Method Summary collapse
- #apply(s) ⇒ Object
-
#initialize(other) ⇒ Zip
constructor
A new instance of Zip.
- #inspect ⇒ Object
Constructor Details
#initialize(other) ⇒ Zip
Returns a new instance of Zip.
172 173 174 |
# File 'lib/d-stream.rb', line 172 def initialize(other) @other = other end |
Instance Method Details
#apply(s) ⇒ Object
180 181 182 183 184 185 186 |
# File 'lib/d-stream.rb', line 180 def apply(s) Enumerator.new do |y| s.lazy.zip(@other).each do |e, i| y << [e, i] end end.lazy end |
#inspect ⇒ Object
176 177 178 |
# File 'lib/d-stream.rb', line 176 def inspect "<DStream::Zip #{@other.inspect}>" end |