Class: DashOverlord::UseCases::V1::Shared::SearchAndPaginate::ApplyPagination

Inherits:
Base
  • Object
show all
Defined in:
lib/dash_overlord/use_cases/v1/shared/search_and_paginate/apply_pagination.rb

Constant Summary collapse

PAGE_DEFAULT =
1
PER_PAGE_DEFAULT =
10

Constants inherited from Base

Base::AbortError

Instance Attribute Summary

Attributes inherited from Base

#context

Instance Method Summary collapse

Methods inherited from Base

context_reader, #final, #initialize, perform, target, #target_valid?

Constructor Details

This class inherits a constructor from DashOverlord::UseCases::Base

Instance Method Details

#performObject



16
17
18
19
20
21
22
23
24
# File 'lib/dash_overlord/use_cases/v1/shared/search_and_paginate/apply_pagination.rb', line 16

def perform
  context.page = fix_page(page)

  if page == 0
    no_pagination
  else
    apply_pagination
  end
end