array.rb

Path: lib/will_paginate/array.rb
Last Update: Sun Oct 26 15:36:07 +0000 2008
dot/f_1.png

Required files

will_paginate/collection  

Methods

paginate  

Public Instance methods

[Source]

    # File lib/will_paginate/array.rb, line 5
 5:   def paginate(options = {})
 6:     raise ArgumentError, "parameter hash expected (got #{options.inspect})" unless Hash === options
 7:     
 8:     WillPaginate::Collection.create(
 9:         options[:page] || 1,
10:         options[:per_page] || 30,
11:         options[:total_entries] || self.length
12:     ) { |pager|
13:       pager.replace self[pager.offset, pager.per_page].to_a
14:     }
15:   end

[Validate]