Class: Getto::Params::Search::Page
- Inherits:
-
Object
- Object
- Getto::Params::Search::Page
- Defined in:
- lib/getto/params/search.rb
Instance Method Summary collapse
-
#initialize(page:, limit:) ⇒ Page
constructor
A new instance of Page.
- #to_h ⇒ Object
Constructor Details
#initialize(page:, limit:) ⇒ Page
Returns a new instance of Page.
33 34 35 36 |
# File 'lib/getto/params/search.rb', line 33 def initialize(page:, limit:) @page = page @limit = limit end |
Instance Method Details
#to_h ⇒ Object
38 39 40 41 42 43 |
# File 'lib/getto/params/search.rb', line 38 def to_h { limit: @limit, offset: (@page.to_i - 1) * @limit, } end |