Sha256: 213eaf53fb8d03f456fb5dd7a128415c74896be63785a3548b91075a3718ae90

Contents?: true

Size: 310 Bytes

Versions: 5

Compression:

Stored size: 310 Bytes

Contents

module Redlander
  module StreamEnumerator
    include Enumerable

    def each
      if block_given?
        reset_stream
        while !@stream.eos?
          yield @stream.current
          @stream.succ
        end
      else
        raise ::LocalJumpError.new("no block given")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redlander-0.3.6 lib/redlander/stream_enumerator.rb
redlander-0.3.5 lib/redlander/stream_enumerator.rb
redlander-0.3.3 lib/redlander/stream_enumerator.rb
redlander-0.3.2 lib/redlander/stream_enumerator.rb
redlander-0.3.1 lib/redlander/stream_enumerator.rb