Sha256: 20d7003f4ca51330891acdd14d275284edc2bdc5ea016b061561479d725ff8d3

Contents?: true

Size: 192 Bytes

Versions: 11

Compression:

Stored size: 192 Bytes

Contents

class Array
 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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
brick_layer-0.10.6 lib/brick_layer/extensions.rb
brick_layer-0.10.5 lib/brick_layer/extensions.rb
brick_layer-0.10.3 lib/brick_layer/extensions.rb
brick_layer-0.10.2 lib/brick_layer/extensions.rb
brick_layer-0.10.1 lib/brick_layer/extensions.rb
brick_layer-0.10.0 lib/brick_layer/extensions.rb
brick_layer-0.9.6 lib/brick_layer/extensions.rb
brick_layer-0.9.4 lib/brick_layer/extensions.rb
brick_layer-0.9.2 lib/brick_layer/extensions.rb
brick_layer-0.9.1 lib/brick_layer/extensions.rb
brick_layer-0.9.0 lib/brick_layer/extensions.rb