Parent

Included Modules

Files

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 182
def +(other)
  to_i + other.to_i
end
-(other) click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 186
def -(other)
  to_i - other.to_i
end
<=>(other) click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 190
def <=>(other)
  to_i <=> other.to_i
end
current?() click to toggle source

current page or not

# File lib/kaminari/helpers/paginator.rb, line 130
def current?
  @page == @options[:current_page]
end
first?() click to toggle source

the first page or not

# File lib/kaminari/helpers/paginator.rb, line 135
def first?
  @page == 1
end
inside_window?() click to toggle source

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
last?() click to toggle source

the last page or not

# File lib/kaminari/helpers/paginator.rb, line 140
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 155
def left_outer?
  @page <= @options[:left]
end
next?() click to toggle source

the next page or not

# File lib/kaminari/helpers/paginator.rb, line 150
def next?
  @page == @options[:current_page] + 1
end
number() click to toggle source

the page number

# File lib/kaminari/helpers/paginator.rb, line 125
def number
  @page
end
prev?() click to toggle source

the previous page or not

# File lib/kaminari/helpers/paginator.rb, line 145
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 160
def right_outer?
  @options[:total_pages] - @page < @options[:right]
end
to_i() click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 174
def to_i
  number
end
to_s() click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 178
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 170
def was_truncated?
  @last.is_a? Gap
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.