Sha256: bf0e55d59b8fd18319c0801515194686e222147a7a757a58fe3aec3744905de6

Contents?: true

Size: 331 Bytes

Versions: 75

Compression:

Stored size: 331 Bytes

Contents

# frozen_string_literal: true

class LHS::Pagination::Page < LHS::Pagination::Base

  DEFAULT_OFFSET = 1

  def current_page
    offset
  end

  def next_offset(step = 1)
    self.class.next_offset(current_page, limit, step)
  end

  def self.next_offset(current_page, _limit, step = 1)
    current_page.to_i + step.to_i
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
lhs-22.1.1.pre lib/lhs/pagination/page.rb
lhs-22.1.0 lib/lhs/pagination/page.rb
lhs-22.0.0 lib/lhs/pagination/page.rb
lhs-21.3.1 lib/lhs/pagination/page.rb
lhs-21.3.0 lib/lhs/pagination/page.rb
lhs-21.3.0.pre.autoauth.1 lib/lhs/pagination/page.rb
lhs-21.2.4 lib/lhs/pagination/page.rb
lhs-21.2.3 lib/lhs/pagination/page.rb
lhs-21.2.3.pre.preload.pre.providers.pre.too.1 lib/lhs/pagination/page.rb
lhs-21.2.2 lib/lhs/pagination/page.rb
lhs-21.2.1 lib/lhs/pagination/page.rb
lhs-21.2.0 lib/lhs/pagination/page.rb
lhs-21.1.4 lib/lhs/pagination/page.rb
lhs-21.1.3 lib/lhs/pagination/page.rb
lhs-21.1.2 lib/lhs/pagination/page.rb
lhs-21.1.2.pre.keyfix.2 lib/lhs/pagination/page.rb
lhs-21.1.2.pre.keyfix.1 lib/lhs/pagination/page.rb
lhs-21.1.2.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/pagination/page.rb
lhs-21.1.1.pre.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/pagination/page.rb
lhs-21.1.0 lib/lhs/pagination/page.rb