class Folio::WillPaginate::ActiveRecord::Pagination::PageProxy
turns the sequence of calls made by Folio::Ordinal#paginate
into the construction of an appropriate relation
Attributes
current_page[W]
called during Folio#configure_pagination
, used to build up @rel from @target and the arguments
Public Class Methods
new(target)
click to toggle source
# File lib/folio/will_paginate/active_record.rb, line 59 def initialize(target) @target = target end
Public Instance Methods
current_page()
click to toggle source
called during Folio::Ordinal#configure_pagination
for bounds checking, before the proxy has been replaced by its result
# File lib/folio/will_paginate/active_record.rb, line 80 def current_page @rel.current_page end
out_of_bounds?()
click to toggle source
# File lib/folio/will_paginate/active_record.rb, line 84 def out_of_bounds? @rel.out_of_bounds? end
per_page=(per_page)
click to toggle source
# File lib/folio/will_paginate/active_record.rb, line 69 def per_page=(per_page) @rel = @target.limit(per_page.to_i).page(@current_page) @rel.limit_value end
result()
click to toggle source
get the result of the construction back out during fill_page
# File lib/folio/will_paginate/active_record.rb, line 89 def result @rel end
total_entries=(total_entries)
click to toggle source
# File lib/folio/will_paginate/active_record.rb, line 74 def total_entries=(total_entries) @rel.total_entries = total_entries end