Class: Kaminari::Helpers::PaginationRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/kaminari/helpers/helpers.rb

Overview

The main class that controlls the whole process

Instance Method Summary collapse

Constructor Details

#initialize(template, options) ⇒ PaginationRenderer

:nodoc:



38
39
40
41
42
43
44
45
46
# File 'lib/kaminari/helpers/helpers.rb', line 38

def initialize(template, options) #:nodoc:
  @window_options = {}.tap do |h|
    h[:window] = options.delete(:window) || options.delete(:inner_window) || 4
    outer_window = options.delete(:outer_window)
    h[:left] = options.delete(:left) || outer_window || 1
    h[:right] = options.delete(:right) || outer_window || 1
  end
  @template = TemplateWrapper.new(template, options)
end

Instance Method Details

#to_sObject

:nodoc:



48
49
50
51
52
# File 'lib/kaminari/helpers/helpers.rb', line 48

def to_s #:nodoc:
  suppress_logging_render_partial do
    Paginator.new(@template, @window_options).to_s
  end
end