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

Initialize pagination renderer



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

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

Instance Method Details

#renderObject

Render pagination links



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

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