current_page=(page)
public
Sets the current
page number of this paginator. If page is a Page object,
its number attribute is used as the value; if the page does not
belong to this Paginator, an ArgumentError is raised.
Show source
def current_page=(page)
if page.is_a? Page
raise ArgumentError, 'Page/Paginator mismatch' unless
page.paginator == self
end
page = page.to_i
@current_page_number = has_page_number?(page) ? page : 1
end