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.
8 9 10 |
# File 'lib/search_object/plugin/paging.rb', line 8 def page @page end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
8 9 10 |
# File 'lib/search_object/plugin/paging.rb', line 8 def per_page @per_page end |
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/search_object/plugin/paging.rb', line 4 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#initialize(options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/search_object/plugin/paging.rb', line 10 def initialize( = {}) @page = [[:page].to_i, 0].max @per_page = self.class.calculate_per_page [:per_page] super end |