Sha256: 60b1c76cb6137287d0494e0a0edd7cae65b758edc3d3d18b67c02ecb72b2d4f2

Contents?: true

Size: 244 Bytes

Versions: 1

Compression:

Stored size: 244 Bytes

Contents

module PageByPage
  class Enum

    def initialize from: 1, step: 1, limit: nil, enumerator: nil
      @enum = enumerator || (from..limit).step(step).lazy.map(&:to_i).to_enum
    end

    def next
      @enum.next rescue nil
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
page_by_page-0.1.14 lib/page_by_page/enum.rb