Method: Mongoid::Contexts::Paging#page

Defined in:
lib/mongoid/contexts/paging.rb

#pageObject

Either returns the page option and removes it from the options, or returns a default value of 1.

Returns:

An Integer page number.



27
28
29
30
# File 'lib/mongoid/contexts/paging.rb', line 27

def page
  skips, limits = options[:skip], options[:limit]
  (skips && limits) ? (skips + limits) / limits : 1
end