Sha256: 18582279c93fc51a6662b31aa8955d8018dbaff40f8a15291eb6021f21be705f
Contents?: true
Size: 587 Bytes
Versions: 7
Compression:
Stored size: 587 Bytes
Contents
module Pagify # array paginator would just simply assume your data is an array, # and create pages simply for your_data[offset, per_page] # if your data is much more complex, use Paginator instead of this class ArrayPager < BasicPager attr_reader :data # data that you passed in this paginator def initialize data, opts = {} @data = data super(opts.merge( :fetcher => lambda{ |offset, per_page| data[offset, per_page] }, :counter => lambda{ data.size })) end end # of ArrayPager end # of Pagify
Version data entries
7 entries across 7 versions & 2 rubygems