Sha256: c75a8d31aea847fcb98988ad7c079fd97495dcfabdf3713fe83f3981b5df251f

Contents?: true

Size: 327 Bytes

Versions: 8

Compression:

Stored size: 327 Bytes

Contents

# frozen_string_literal: true
module Split
  class DashboardPaginator
    def initialize(collection, page_number, per)
      @collection = collection
      @page_number = page_number
      @per = per
    end

    def paginate
      to = @page_number * @per
      from = to - @per
      @collection[from...to]
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ab-split-1.0.2 lib/split/dashboard/paginator.rb
ab-split-1.0.1 lib/split/dashboard/paginator.rb
ab-split-1.0.0 lib/split/dashboard/paginator.rb
split-3.4.1 lib/split/dashboard/paginator.rb
split-3.4.0 lib/split/dashboard/paginator.rb
split-3.3.2 lib/split/dashboard/paginator.rb
split-3.3.1 lib/split/dashboard/paginator.rb
split-3.3.0 lib/split/dashboard/paginator.rb