class

Array(T)

Inherits Comparable < Indexable::Mutable < Indexable < Enumerable < Iterable < Reference < Object

Порт array.rb: пагинация статического массива (извлечение подмножества). Результат — WillPaginate::Collection(T), массив с данными о пагинации.

arr = ['a', 'b', 'c', 'd', 'e'] paged = arr.paginate(per_page: 2) #-> ['a', 'b'] paged.total_entries #-> 5 arr.paginate(page: 2, per_page: 2) #-> ['c', 'd'] arr.paginate(page: 3, per_page: 2) #-> ['e']

Instance methods

paginate(page : WillPaginate::PageNumber | Int32 | Int64 | String = 1, per_page : Int32 | Nil = nil, total_entries : Int32 | Nil = nil)