Class: Gcloud::Bigquery::Dataset::List

Inherits:
Array
  • Object
show all
Defined in:
lib/gcloud/bigquery/dataset/list.rb

Overview

Dataset::List is a special case Array with additional values.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr = []) ⇒ List

Create a new Dataset::List with an array of datasets.



32
33
34
# File 'lib/gcloud/bigquery/dataset/list.rb', line 32

def initialize arr = []
  super arr
end

Instance Attribute Details

#etagObject

A hash of this page of results.



28
29
30
# File 'lib/gcloud/bigquery/dataset/list.rb', line 28

def etag
  @etag
end

#tokenObject

If not empty, indicates that there are more records that match the request and this value should be passed to continue.



25
26
27
# File 'lib/gcloud/bigquery/dataset/list.rb', line 25

def token
  @token
end

Class Method Details

.from_resp(resp, conn) ⇒ Object

New Dataset::List from a response object.



38
39
40
41
42
43
44
45
46
47
# File 'lib/gcloud/bigquery/dataset/list.rb', line 38

def self.from_resp resp, conn #:nodoc:
  datasets = List.new(Array(resp.data["datasets"]).map do |gapi_object|
    Dataset.from_gapi gapi_object, conn
  end)
  datasets.instance_eval do
    @token = resp.data["nextPageToken"]
    @etag = resp.data["etag"]
  end
  datasets
end