class Getto::Params::Search::Page

Public Class Methods

new(page:, limit:) click to toggle source
# File lib/getto/params/search.rb, line 37
def initialize(page:, limit:)
  @page  = page
  @limit = limit
end

Public Instance Methods

to_h() click to toggle source
# File lib/getto/params/search.rb, line 42
def to_h
  {
    limit: @limit,
    offset: (@page.to_i - 1) * @limit,
  }
end