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.17.1 lib/backports/1.8.7/enumerator.rb
backports-1.17.0 lib/backports/1.8.7/enumerator.rb
backports-1.16.7 lib/backports/1.8.7/enumerator.rb
backports-1.16.6 lib/backports/1.8.7/enumerator.rb
backports-1.16.5 lib/backports/1.8.7/enumerator.rb
backports-1.16.4 lib/backports/1.8.7/enumerator.rb
backports-1.16.3 lib/backports/1.8.7/enumerator.rb
backports-1.16.2 lib/backports/1.8.7/enumerator.rb
backports-1.16.1 lib/backports/1.8.7/enumerator.rb
backports-1.15.0 lib/backports/1.8.7/enumerator.rb
backports-1.14.1 lib/backports/1.8.7/enumerator.rb
backports-1.14.0 lib/backports/1.8.7/enumerator.rb
backports-1.13.3 lib/backports/1.8.7/enumerator.rb
backports-1.13.2 lib/backports/1.8.7/enumerator.rb
backports-1.13.1 lib/backports/1.8.7/enumerator.rb
backports-1.13.0 lib/backports/1.8.7/enumerator.rb
backports-1.12.3 lib/backports/1.8.7/enumerator.rb
backports-1.12.2 lib/backports/1.8.7/enumerator.rb
backports-1.12.1 lib/backports/1.8.7/enumerator.rb
backports-1.12.0 lib/backports/1.8.7/enumerator.rb