Class: Tenon::PaginatingSerializer
- Inherits:
-
ActiveModel::Serializer::CollectionSerializer
- Object
- ActiveModel::Serializer::CollectionSerializer
- Tenon::PaginatingSerializer
- Defined in:
- app/serializers/tenon/paginating_serializer.rb
Instance Method Summary collapse
-
#initialize(object, options = {}) ⇒ PaginatingSerializer
constructor
A new instance of PaginatingSerializer.
Constructor Details
#initialize(object, options = {}) ⇒ PaginatingSerializer
Returns a new instance of PaginatingSerializer.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/serializers/tenon/paginating_serializer.rb', line 5 def initialize(object, = {}) = [:meta_key] || :meta [] ||= {} [][:pagination] = { current_page: object.current_page, per_page: object.per_page, offset: object.offset, total_pages: object.total_pages, total_entries: object.total_entries } super(object, ) end |