Class: Whatsapp::MessageTemplates::Response::Paging
- Inherits:
-
Object
- Object
- Whatsapp::MessageTemplates::Response::Paging
- Defined in:
- lib/ruby/whatsapp/message_templates/response/paging.rb
Overview
Graph API cursor pagination for a template list.
Flattens the nested paging.cursors object, since the intermediate level
carries no information of its own.
Source: https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account/message_templates/
Instance Attribute Summary collapse
-
#after ⇒ String?
Cursor for the next page.
-
#before ⇒ String?
Cursor for the previous page.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(before: nil, after: nil) ⇒ Paging
constructor
A new instance of Paging.
Constructor Details
#initialize(before: nil, after: nil) ⇒ Paging
Returns a new instance of Paging.
22 23 24 25 |
# File 'lib/ruby/whatsapp/message_templates/response/paging.rb', line 22 def initialize(before: nil, after: nil) @before = before @after = after end |
Instance Attribute Details
#after ⇒ String?
Returns Cursor for the next page.
18 19 20 |
# File 'lib/ruby/whatsapp/message_templates/response/paging.rb', line 18 def after @after end |
#before ⇒ String?
Returns Cursor for the previous page.
14 15 16 |
# File 'lib/ruby/whatsapp/message_templates/response/paging.rb', line 14 def before @before end |
Class Method Details
.deserialize(data) ⇒ Paging
30 31 32 33 34 |
# File 'lib/ruby/whatsapp/message_templates/response/paging.rb', line 30 def deserialize(data) cursors = (data || {})["cursors"] || {} new(before: cursors["before"], after: cursors["after"]) end |