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-26.2.0 lib/lhs/pagination/page.rb
lhs-26.1.0 lib/lhs/pagination/page.rb
lhs-26.0.1 lib/lhs/pagination/page.rb
lhs-26.0.0 lib/lhs/pagination/page.rb
lhs-25.2.0 lib/lhs/pagination/page.rb
lhs-25.1.0 lib/lhs/pagination/page.rb
lhs-25.0.4 lib/lhs/pagination/page.rb
lhs-25.0.3 lib/lhs/pagination/page.rb
lhs-25.0.2 lib/lhs/pagination/page.rb
lhs-25.0.1 lib/lhs/pagination/page.rb
lhs-25.0.0 lib/lhs/pagination/page.rb
lhs-24.1.2 lib/lhs/pagination/page.rb
lhs-24.1.1 lib/lhs/pagination/page.rb
lhs-24.1.0 lib/lhs/pagination/page.rb
lhs-24.1.0.pre.2 lib/lhs/pagination/page.rb
lhs-24.1.0.pre.1 lib/lhs/pagination/page.rb
lhs-24.0.0 lib/lhs/pagination/page.rb
lhs-23.0.2 lib/lhs/pagination/page.rb
lhs-23.0.1 lib/lhs/pagination/page.rb
lhs-23.0.0 lib/lhs/pagination/page.rb