Sha256: d6b9994f83c7fb17c887a9f027239b5befb7ffb5cd4e7e1a756ce6f745fa9cce
Contents?: true
Size: 440 Bytes
Versions: 75
Compression:
Stored size: 440 Bytes
Contents
# frozen_string_literal: true class LHS::Pagination::Offset < LHS::Pagination::Base DEFAULT_OFFSET = 0 def current_page (offset + limit) / limit end def next_offset(step = 1) self.class.next_offset(offset, limit, step) end def self.page_to_offset(page, limit = DEFAULT_LIMIT) (page.to_i - 1) * limit.to_i end def self.next_offset(offset, limit, step = 1) offset.to_i + limit.to_i * step.to_i end end
Version data entries
75 entries across 75 versions & 1 rubygems