Class: JSONAPI::Paginator

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonapi/paginator.rb

Direct Known Subclasses

OffsetPaginator, PagedPaginator

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_params) ⇒ Paginator

Returns a new instance of Paginator


3
4
# File 'lib/jsonapi/paginator.rb', line 3

def initialize(_params)
end

Class Method Details

.paginator_for(paginator) ⇒ Object


23
24
25
26
# File 'lib/jsonapi/paginator.rb', line 23

def paginator_for(paginator)
  paginator_class_name = "#{paginator.to_s.camelize}Paginator"
  paginator_class_name.safe_constantize if paginator_class_name
end

.requires_record_countObject


17
18
19
20
21
# File 'lib/jsonapi/paginator.rb', line 17

def requires_record_count
  # :nocov:
  false
  # :nocov:
end

Instance Method Details

#apply(_relation, _order_options) ⇒ Object


6
7
8
# File 'lib/jsonapi/paginator.rb', line 6

def apply(_relation, _order_options)
  # relation
end

10
11
12
13
14
# File 'lib/jsonapi/paginator.rb', line 10

def links_page_params(_options = {})
  # :nocov:
  {}
  # :nocov:
end