| Path: | lib/will_paginate/array.rb |
| Last Update: | Tue Jan 19 01:25:15 -0600 2010 |
# 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