Class: Pyper::Pipes::Cassandra::PaginationDecoding
- Inherits:
-
Object
- Object
- Pyper::Pipes::Cassandra::PaginationDecoding
- Defined in:
- lib/pyper/pipes/cassandra/pagination_decoding.rb
Overview
This pipe extracts an encoded paging_state, decodes it, and passes on a decoded paging state. This pipe is intended to be used before the Cassandra::Reader pipe, as that pipe can interpret the :paging_state argument.
This pipe pairs with the PaginationEncoding pipe, which performs the reverse transformation
Instance Method Summary collapse
-
#pipe(args, status = {}) ⇒ Hash
The list of arguments with :paging_state decoded, if present.
Instance Method Details
#pipe(args, status = {}) ⇒ Hash
Returns The list of arguments with :paging_state decoded, if present.
16 17 18 19 20 |
# File 'lib/pyper/pipes/cassandra/pagination_decoding.rb', line 16 def pipe(args, status = {}) page_state = args[:paging_state] args[:paging_state] = Base64.urlsafe_decode64(page_state) if page_state args end |