Sha256: 31a5e27f168006f471d9abaa983b87876edfc0726c47c37db9e127d34b9a0fc2

Contents?: true

Size: 453 Bytes

Versions: 9

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Trailblazer
  class Finder
    module Adapters
      # ActiveRecord Adapter
      module Basic
        # Basic Paging Adapter
        module Paging
          module_function

          def set_paging_handler
            lambda do |current_page, per_page, entity|
              entity.drop(([current_page, 1].max - 1) * per_page).first(per_page)
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trailblazer-finder-0.50.0 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.10.3 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.10.2 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.10.1 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.10.0 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.3.0 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.2.7 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.2.6 lib/trailblazer/finder/adapters/basic/paging.rb
trailblazer-finder-0.2.5 lib/trailblazer/finder/adapters/basic/paging.rb