Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/brick_layer/extensions.rb

Instance Method Summary collapse

Instance Method Details

#paginate(options = {:page => 1, :per_page => 50}) ⇒ Object



2
3
4
5
6
7
# File 'lib/brick_layer/extensions.rb', line 2

def paginate(options={:page => 1, :per_page => 50})
  page     = options[:page]
  per_page = options[:per_page]
  
  self[((page - 1) * per_page)...(page * per_page)]
end