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.
37 38 39 40 |
# File 'lib/getto/params/search.rb', line 37 def initialize(page:, limit:) @page = page @limit = limit end |
Instance Method Details
#to_h ⇒ Object
42 43 44 45 46 47 |
# File 'lib/getto/params/search.rb', line 42 def to_h { limit: @limit, offset: (@page.to_i - 1) * @limit, } end |