Class: Gcloud::Storage::Bucket::List
- Inherits:
-
Array
- Object
- Array
- Gcloud::Storage::Bucket::List
- Defined in:
- lib/gcloud/storage/bucket/list.rb
Overview
Bucket::List is a special case Array with additional values.
Instance Attribute Summary collapse
-
#token ⇒ Object
If not empty, indicates that there are more buckets that match the request and this value should be passed to the next Gcloud::Storage::Project#buckets to continue.
Class Method Summary collapse
-
.from_resp(resp, conn) ⇒ Object
New Bucket::List from a response object.
Instance Method Summary collapse
-
#initialize(arr = [], token = nil) ⇒ List
constructor
Create a new Bucket::List with an array of values.
Constructor Details
#initialize(arr = [], token = nil) ⇒ List
Create a new Bucket::List with an array of values.
30 31 32 33 |
# File 'lib/gcloud/storage/bucket/list.rb', line 30 def initialize arr = [], token = nil super arr @token = token end |
Instance Attribute Details
#token ⇒ Object
If not empty, indicates that there are more buckets that match the request and this value should be passed to the next Gcloud::Storage::Project#buckets to continue.
26 27 28 |
# File 'lib/gcloud/storage/bucket/list.rb', line 26 def token @token end |
Class Method Details
.from_resp(resp, conn) ⇒ Object
New Bucket::List from a response object.
37 38 39 40 41 42 |
# File 'lib/gcloud/storage/bucket/list.rb', line 37 def self.from_resp resp, conn #:nodoc: buckets = Array(resp.data["items"]).map do |gapi_object| Bucket.from_gapi gapi_object, conn end new buckets, resp.data["nextPageToken"] end |