Class: Apiwork::Adapter::Standard::Capability::Pagination::APIBuilder
- Inherits:
-
Capability::API::Base
- Object
- Builder::API::Base
- Capability::API::Base
- Apiwork::Adapter::Standard::Capability::Pagination::APIBuilder
- Defined in:
- lib/apiwork/adapter/standard/capability/pagination/api_builder.rb
Instance Attribute Summary
Attributes inherited from Capability::API::Base
Attributes inherited from Builder::API::Base
Instance Method Summary collapse
Methods inherited from Capability::API::Base
Methods inherited from Builder::API::Base
#enum, #enum?, #initialize, #object, #type?, #union
Constructor Details
This class inherits a constructor from Apiwork::Adapter::Capability::API::Base
Instance Method Details
#build ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/apiwork/adapter/standard/capability/pagination/api_builder.rb', line 9 def build return unless scope.index_actions? if configured(:strategy).include?(:offset) object(:offset_pagination) do |object| object.integer(:current) object.integer?(:next, nullable: true) object.integer?(:prev, nullable: true) object.integer(:total) object.integer(:items) end end return unless configured(:strategy).include?(:cursor) object(:cursor_pagination) do |object| object.string?(:next, nullable: true) object.string?(:prev, nullable: true) end end |