Sha256: 8235a986f928a68414a2ce44bd326c15b05b491983b42311c8b0b759c9b28faa

Contents?: true

Size: 574 Bytes

Versions: 26

Compression:

Stored size: 574 Bytes

Contents

require 'enumerator'
if (Enumerable::Enumerator rescue false)
  module Enumerable
    class Enumerator
      def next
        require 'generator'
        @generator ||= Generator.new(self)
        raise StopIteration unless @generator.next?
        @generator.next
      end unless method_defined? :next

      def rewind
        @object.rewind if @object.respond_to? :rewind
        require 'generator'
        @generator ||= Generator.new(self)
        @generator.rewind
        self
      end unless method_defined? :rewind
    end if const_defined? :Enumerator
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
backports-1.11.2 lib/backports/1.8.7/enumerator.rb
backports-1.11.1 lib/backports/1.8.7/enumerator.rb
backports-1.11.0 lib/backports/1.8.7/enumerator.rb
backports-1.10.3 lib/backports/1.8.7/enumerator.rb
backports-1.10.2 lib/backports/1.8.7/enumerator.rb
backports-1.10.1 lib/backports/1.8.7/enumerator.rb