Module: SearchObject::Plugin::Paging

Included in:
Kaminari, WillPaginate
Defined in:
lib/search_object/plugin/paging.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



10
11
12
# File 'lib/search_object/plugin/paging.rb', line 10

def page
  @page
end

#per_pageObject (readonly)

Returns the value of attribute per_page.



10
11
12
# File 'lib/search_object/plugin/paging.rb', line 10

def per_page
  @per_page
end

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/search_object/plugin/paging.rb', line 6

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#initialize(options = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/search_object/plugin/paging.rb', line 12

def initialize(options = {})
  @page     = [options[:page].to_i, 0].max
  @per_page = self.class.calculate_per_page options[:per_page]

  super options
end