Class: PR::Pin::Adapter::Relation

Inherits:
ROM::HTTP::Relation
  • Object
show all
Defined in:
lib/pr/pin/adapter/relation.rb

Instance Method Summary collapse

Instance Method Details

#input_schemaObject



21
22
23
# File 'lib/pr/pin/adapter/relation.rb', line 21

def input_schema
  ROM::Command.input
end

#paginateObject

Raises:



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pr/pin/adapter/relation.rb', line 7

def paginate
  materialized = dataset.materialize

  raise(
    NoPaginationError,
    dataset.uri
  ) unless materialized.paginates?

  PaginatedResponse.new(
    new(materialized).to_a,
    materialized.pagination_params
  )
end