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 140 def +(other) to_i + other.to_i end
-(other)
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 144 def -(other) to_i - other.to_i end
<=>(other)
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 148 def <=>(other) to_i <=> other.to_i end
current?()
click to toggle source
current page or not
# File lib/kaminari/helpers/paginator.rb, line 88 def current? @page == @options[:current_page] end
first?()
click to toggle source
the first page or not
# File lib/kaminari/helpers/paginator.rb, line 93 def first? @page == 1 end
inside_window?()
click to toggle source
inside the inner window or not
# File lib/kaminari/helpers/paginator.rb, line 123 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 98 def last? @page == @options[:num_pages] end
left_outer?()
click to toggle source
within the left outer window or not
# File lib/kaminari/helpers/paginator.rb, line 113 def left_outer? @page <= @options[:left] end
next?()
click to toggle source
the next page or not
# File lib/kaminari/helpers/paginator.rb, line 108 def next? @page == @options[:current_page] + 1 end
number()
click to toggle source
the page number
# File lib/kaminari/helpers/paginator.rb, line 83 def number @page end
prev?()
click to toggle source
the previous page or not
# File lib/kaminari/helpers/paginator.rb, line 103 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 118 def right_outer? @options[:num_pages] - @page < @options[:right] end
to_i()
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 132 def to_i number end
to_s()
click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 136 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 128 def was_truncated? @last.is_a? Gap end