Class: Yancya::BigQuery::Table
- Inherits:
-
Object
- Object
- Yancya::BigQuery::Table
- Defined in:
- lib/yancya/big_query/table.rb
Instance Method Summary collapse
- #dataset_id ⇒ Object
- #delete ⇒ Object
- #description ⇒ Object
-
#initialize(resource:, tables:) ⇒ Table
constructor
A new instance of Table.
- #patch(table_reference:) ⇒ Object
- #project_id ⇒ Object
- #reload ⇒ Object
- #schema ⇒ Object
- #table_id ⇒ Object
- #update(table_reference:) ⇒ Object
Constructor Details
#initialize(resource:, tables:) ⇒ Table
4 5 6 7 |
# File 'lib/yancya/big_query/table.rb', line 4 def initialize(resource:, tables:) @resource = resource @tables = tables end |
Instance Method Details
#dataset_id ⇒ Object
13 14 15 |
# File 'lib/yancya/big_query/table.rb', line 13 def dataset_id table_reference["datasetId"] end |
#delete ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/yancya/big_query/table.rb', line 37 def delete @tables.delete( project_id: project_id, dataset_id: dataset_id, table_id: table_id ) end |
#description ⇒ Object
21 22 23 |
# File 'lib/yancya/big_query/table.rb', line 21 def description @resource["description"] end |
#patch(table_reference:) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/yancya/big_query/table.rb', line 45 def patch(table_reference:) @tables.patch( project_id: project_id, dataset_id: dataset_id, table_id: table_id, table: table_reference ) end |
#project_id ⇒ Object
9 10 11 |
# File 'lib/yancya/big_query/table.rb', line 9 def project_id table_reference["projectId"] end |
#reload ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/yancya/big_query/table.rb', line 29 def reload @tables.get( project_id: project_id, dataset_id: dataset_id, table_id: table_id ) end |
#schema ⇒ Object
25 26 27 |
# File 'lib/yancya/big_query/table.rb', line 25 def schema @resource["schema"] end |
#table_id ⇒ Object
17 18 19 |
# File 'lib/yancya/big_query/table.rb', line 17 def table_id table_reference["tableId"] end |
#update(table_reference:) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/yancya/big_query/table.rb', line 54 def update(table_reference:) @tables.update( project_id: project_id, dataset_id: dataset_id, table_id: table_id, table: table_reference ) end |