Sha256: bfd37300263330b520d536d5836ffcdb1df104381b32184aed12bf3d467c08f2
Contents?: true
Size: 730 Bytes
Versions: 1
Compression:
Stored size: 730 Bytes
Contents
module Xing::Services # If you want to use the PagedList serializers, but are using resources that # aren't actually provided by Kaminari, you can instead feed them to # PageWrapper and you should get everything you need class PageWrapper include Enumerable def initialize(list, page_num, total_items, per_page) @list, @total_items, @per_page, @page_num = list, total_items, per_page, page_num end attr_reader :list, :total_items, :per_page, :page_num alias current_page page_num alias total_count total_items alias limit_value per_page def total_pages (total_items / per_page.to_f).ceil end def each(*args, &block) @list.each(*args, &block) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xing-backend-0.0.19 | lib/xing/services/page_wrapper.rb |