Class: Gcloud::Bigquery::Table::List
- Inherits:
-
Array
- Object
- Array
- Gcloud::Bigquery::Table::List
- Defined in:
- lib/gcloud/bigquery/table/list.rb
Overview
Table::List is a special case Array with additional values.
Instance Attribute Summary collapse
-
#etag ⇒ Object
A hash of this page of results.
-
#token ⇒ Object
If not empty, indicates that there are more records that match the request and this value should be passed to continue.
-
#total ⇒ Object
Total number of jobs in this collection.
Class Method Summary collapse
-
.from_resp(resp, conn) ⇒ Object
New Table::List from a response object.
Instance Method Summary collapse
-
#initialize(arr = []) ⇒ List
constructor
Create a new Table::List with an array of jobs.
Constructor Details
#initialize(arr = []) ⇒ List
Create a new Table::List with an array of jobs.
35 36 37 |
# File 'lib/gcloud/bigquery/table/list.rb', line 35 def initialize arr = [] super arr end |
Instance Attribute Details
#etag ⇒ Object
A hash of this page of results.
28 29 30 |
# File 'lib/gcloud/bigquery/table/list.rb', line 28 def etag @etag end |
#token ⇒ Object
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/table/list.rb', line 25 def token @token end |
#total ⇒ Object
Total number of jobs in this collection.
31 32 33 |
# File 'lib/gcloud/bigquery/table/list.rb', line 31 def total @total end |
Class Method Details
.from_resp(resp, conn) ⇒ Object
New Table::List from a response object.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/gcloud/bigquery/table/list.rb', line 41 def self.from_resp resp, conn #:nodoc: tables = List.new(Array(resp.data["tables"]).map do |gapi_object| Table.from_gapi gapi_object, conn end) tables.instance_eval do @token = resp.data["nextPageToken"] @etag = resp.data["etag"] @total = resp.data["totalItems"] end tables end |