Class: Gcloud::Logging::Entry::List
- Inherits:
-
Array
- Object
- Array
- Gcloud::Logging::Entry::List
- Defined in:
- lib/gcloud/logging/entry/list.rb
Overview
Entry::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.
Instance Method Summary collapse
-
#initialize(arr = []) ⇒ List
constructor
Create a new Entry::List with an array of Entry instances.
-
#next ⇒ Object
Retrieve the next page of entries.
-
#next? ⇒ Boolean
Whether there a next page of entries.
Constructor Details
#initialize(arr = []) ⇒ List
Create a new Entry::List with an array of Entry instances.
31 32 33 |
# File 'lib/gcloud/logging/entry/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/logging/entry/list.rb', line 27 def token @token end |
Instance Method Details
#next ⇒ Object
Retrieve the next page of entries.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/gcloud/logging/entry/list.rb', line 43 def next return nil unless next? ensure_connection! resp = @connection.list_entries token: token if resp.success? self.class.from_response resp, @connection else fail ApiError.from_response(resp) end end |
#next? ⇒ Boolean
Whether there a next page of entries.
37 38 39 |
# File 'lib/gcloud/logging/entry/list.rb', line 37 def next? !token.nil? end |