Module: Roda::RodaPlugins::WillPaginate

Defined in:
lib/roda/plugins/will_paginate.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.configure(app, opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/roda/plugins/will_paginate.rb', line 7

def self.configure(app, opts = {})
  app.opts[:will_paginate] = opts.dup

  opts = app.opts[:will_paginate]
  opts[:renderer] ||= ::Roda::WillPaginate::LinkRenderer

  if opts[:renderer].is_a?(Symbol)
    c_name = "Roda::WillPaginate::#{opts[:renderer].to_s.capitalize}PaginationRenderer"
    opts[:renderer] = const_get(c_name)
  end
end