Object
Wraps a “page number” and provides some utility methods
# File lib/kaminari/helpers/paginator.rb, line 182 def +(other) to_i + other.to_i end
# File lib/kaminari/helpers/paginator.rb, line 186 def -(other) to_i - other.to_i end
# File lib/kaminari/helpers/paginator.rb, line 190 def <=>(other) to_i <=> other.to_i end
current page or not
# File lib/kaminari/helpers/paginator.rb, line 130 def current? @page == @options[:current_page] end
the first page or not
# File lib/kaminari/helpers/paginator.rb, line 135 def first? @page == 1 end
inside the inner window or not
# File lib/kaminari/helpers/paginator.rb, line 165 def inside_window? (@options[:current_page] - @page).abs <= @options[:window] end
the last page or not
# File lib/kaminari/helpers/paginator.rb, line 140 def last? @page == @options[:total_pages] end
within the left outer window or not
# File lib/kaminari/helpers/paginator.rb, line 155 def left_outer? @page <= @options[:left] end
the next page or not
# File lib/kaminari/helpers/paginator.rb, line 150 def next? @page == @options[:current_page] + 1 end
the page number
# File lib/kaminari/helpers/paginator.rb, line 125 def number @page end
the previous page or not
# File lib/kaminari/helpers/paginator.rb, line 145 def prev? @page == @options[:current_page] - 1 end
within the right outer window or not
# File lib/kaminari/helpers/paginator.rb, line 160 def right_outer? @options[:total_pages] - @page < @options[:right] end
# File lib/kaminari/helpers/paginator.rb, line 174 def to_i number end
Generated with the Darkfish Rdoc Generator 2.