Sha256: 38e2d49e03a8347aca80594b16986d977d18bbb8c962f376f566d55ea7be914c
Contents?: true
Size: 897 Bytes
Versions: 3
Compression:
Stored size: 897 Bytes
Contents
require 'active_support/core_ext/module/deprecation' module GearedPagination class Page attr_reader :recordset def initialize(portion, from:) @portion, @recordset = portion, from end def number @portion.page_number end def records @records ||= @portion.from(recordset.records) end def used? records.load.any? end def empty? records.load.none? end def first? number == 1 end def only? recordset.page_count == 1 end def last? number == recordset.page_count end def before_last? number < recordset.page_count end def next_param @portion.next_param recordset.records end alias_method :next_number, :next_param deprecate next_number: "use #next_param instead" def cache_key "page/#{@portion.cache_key}" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
geared_pagination-1.1.2 | lib/geared_pagination/page.rb |
geared_pagination-1.1.1 | lib/geared_pagination/page.rb |
geared_pagination-1.1.0 | lib/geared_pagination/page.rb |