class Kaminari::Helpers::Paginator::PageProxy
Wraps a “page number” and provides some utility methods
Public Instance Methods
+(other)
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 175 def +(other) to_i + other.to_i end
-(other)
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 179 def -(other) to_i - other.to_i end
<=>(other)
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 183 def <=>(other) to_i <=> other.to_i end
current?()
click to toggle source
current page or not
# File lib/kaminari/helpers/paginator.rb, line 123 def current? @page == @options[:current_page] end
first?()
click to toggle source
the first page or not
# File lib/kaminari/helpers/paginator.rb, line 128 def first? @page == 1 end
inside_window?()
click to toggle source
inside the inner window or not
# File lib/kaminari/helpers/paginator.rb, line 158 def inside_window? (@options[:current_page] - @page).abs <= @options[:window] end
last?()
click to toggle source
the last page or not
# File lib/kaminari/helpers/paginator.rb, line 133 def last? @page == @options[:total_pages] end
left_outer?()
click to toggle source
within the left outer window or not
# File lib/kaminari/helpers/paginator.rb, line 148 def left_outer? @page <= @options[:left] end
next?()
click to toggle source
the next page or not
# File lib/kaminari/helpers/paginator.rb, line 143 def next? @page == @options[:current_page] + 1 end
number()
click to toggle source
the page number
# File lib/kaminari/helpers/paginator.rb, line 118 def number @page end
prev?()
click to toggle source
the previous page or not
# File lib/kaminari/helpers/paginator.rb, line 138 def prev? @page == @options[:current_page] - 1 end
right_outer?()
click to toggle source
within the right outer window or not
# File lib/kaminari/helpers/paginator.rb, line 153 def right_outer? @options[:total_pages] - @page < @options[:right] end
to_i()
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 167 def to_i number end
to_s()
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 171 def to_s number.to_s end
was_truncated?()
click to toggle source
The last rendered tag was “truncated” or not
# File lib/kaminari/helpers/paginator.rb, line 163 def was_truncated? @last.is_a? Gap end