Class: Bandwidth::PageInfo
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/page_info.rb
Overview
PageInfo Model.
Instance Attribute Summary collapse
-
#next_page ⇒ String
The link to the next page for pagination.
-
#next_page_token ⇒ String
The isolated pagination token for the next page.
-
#prev_page ⇒ String
The link to the previous page for pagination.
-
#prev_page_token ⇒ String
The isolated pagination token for the previous page.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) ⇒ PageInfo
constructor
A new instance of PageInfo.
Methods inherited from BaseModel
Constructor Details
#initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) ⇒ PageInfo
Returns a new instance of PageInfo.
35 36 37 38 39 40 41 42 43 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 35 def initialize(prev_page = nil, next_page = nil, prev_page_token = nil, next_page_token = nil) @prev_page = prev_page @next_page = next_page @prev_page_token = prev_page_token @next_page_token = next_page_token end |
Instance Attribute Details
#next_page ⇒ String
The link to the next page for pagination
15 16 17 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 15 def next_page @next_page end |
#next_page_token ⇒ String
The isolated pagination token for the next page
23 24 25 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 23 def next_page_token @next_page_token end |
#prev_page ⇒ String
The link to the previous page for pagination
11 12 13 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 11 def prev_page @prev_page end |
#prev_page_token ⇒ String
The isolated pagination token for the previous page
19 20 21 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 19 def prev_page_token @prev_page_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. prev_page = hash['prevPage'] next_page = hash['nextPage'] prev_page_token = hash['prevPageToken'] next_page_token = hash['nextPageToken'] # Create object from extracted values. PageInfo.new(prev_page, next_page, prev_page_token, next_page_token) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 33 |
# File 'lib/bandwidth/messaging_lib/messaging/models/page_info.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['prev_page'] = 'prevPage' @_hash['next_page'] = 'nextPage' @_hash['prev_page_token'] = 'prevPageToken' @_hash['next_page_token'] = 'nextPageToken' @_hash end |