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
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
10 11 12 |
# File 'lib/search_object/plugin/paging.rb', line 10 def page @page end |
#per_page ⇒ Object (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( = {}) @page = [[:page].to_i, 0].max @per_page = self.class.calculate_per_page [:per_page] super end |