Class: SmartPagination::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_pagination/renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, collection, options = {}) ⇒ Renderer

Returns a new instance of Renderer.



3
4
5
6
7
# File 'lib/smart_pagination/renderer.rb', line 3

def initialize(context, collection, options = {})
  @context    = context
  @collection = collection
  @options    = default_options.merge(options)
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/smart_pagination/renderer.rb', line 9

def render
  if auto_hide?
    nil
  elsif info_mode?
    pagination_info
  elsif pager_mode?
    pager
  else
    pagination
  end
end