Class: Nom::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/nom-ruby/util.rb

Class Method Summary collapse

Class Method Details

.page(options) ⇒ Object



3
4
5
6
7
8
# File 'lib/nom-ruby/util.rb', line 3

def self.page(options)
  start = options[:start].present? ? options[:start] : 0
  limit = options[:limit].present? ? options[:limit] : 15
  start = 0 if start < 0
  [start, limit]
end