Wrapper for Array to behave like the Sequel pagination
# File lib/ramaze/helper/paginate.rb, line 254 254: def current_page 255: @page 256: end
# File lib/ramaze/helper/paginate.rb, line 274 274: def each(&block) 275: from = ((@page - 1) * @limit) 276: to = from + @limit 277: 278: a = @array[from...to] || [] 279: a.each(&block) 280: end
# File lib/ramaze/helper/paginate.rb, line 245 245: def empty? 246: @array.empty? 247: end
# File lib/ramaze/helper/paginate.rb, line 266 266: def first_page? 267: @page <= 1 268: end
# File lib/ramaze/helper/paginate.rb, line 270 270: def last_page? 271: page_count == @page 272: end
# File lib/ramaze/helper/paginate.rb, line 258 258: def next_page 259: page_count == @page ? nil : @page + 1 260: end
# File lib/ramaze/helper/paginate.rb, line 249 249: def page_count 250: pages, rest = size.divmod(@limit) 251: rest == 0 ? pages : pages + 1 252: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.