Class: Gcloud::Dns::Change::List
- Inherits:
-
Array
- Object
- Array
- Gcloud::Dns::Change::List
- Defined in:
- lib/gcloud/dns/change/list.rb
Overview
Change::List is a special case Array with additional values.
Instance Attribute Summary collapse
-
#token ⇒ Object
If not empty, indicates that there are more records that match the request and this value should be passed to continue.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arr = []) ⇒ List
constructor
Create a new Change::List with an array of Change instances.
-
#next ⇒ Object
Retrieve the next page of zones.
-
#next? ⇒ Boolean
Whether there a next page of zones.
Constructor Details
#initialize(arr = []) ⇒ List
Create a new Change::List with an array of Change instances.
31 32 33 |
# File 'lib/gcloud/dns/change/list.rb', line 31 def initialize arr = [] super arr end |
Instance Attribute Details
#token ⇒ Object
If not empty, indicates that there are more records that match the request and this value should be passed to continue.
27 28 29 |
# File 'lib/gcloud/dns/change/list.rb', line 27 def token @token end |
Class Method Details
.from_response(resp, zone) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/gcloud/dns/change/list.rb', line 51 def self.from_response resp, zone changes = new(Array(resp.data["changes"]).map do |gapi_object| Change.from_gapi gapi_object, zone end) changes.instance_variable_set "@token", resp.data["nextPageToken"] changes.instance_variable_set "@zone", zone changes end |
Instance Method Details
#next ⇒ Object
Retrieve the next page of zones.
43 44 45 46 47 |
# File 'lib/gcloud/dns/change/list.rb', line 43 def next return nil unless next? ensure_zone! @zone.changes token: token end |
#next? ⇒ Boolean
Whether there a next page of zones.
37 38 39 |
# File 'lib/gcloud/dns/change/list.rb', line 37 def next? !token.nil? end |