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



30
31
32
33
# File 'lib/jsonapi/paginator.rb', line 30

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



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

def requires_record_count
  # :nocov:
  # @deprecated
  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

#requires_record_countObject



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

def requires_record_count
  # :nocov:
  self.class.requires_record_count
  # :nocov:
end