Class: FusionTablesV2::Table

Inherits:
API::Table
  • Object
show all
Defined in:
lib/fusion_tables_v2.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dbObject

Returns the value of attribute db.



8
9
10
# File 'lib/fusion_tables_v2.rb', line 8

def db
  @db
end

Class Method Details

.build(is_exportable: false, name:, db:) ⇒ Object

attribution string Attribution assigned to the table. writable attributionLink string Optional link for attribution. writable baseTableIds[] list Base table identifier if this table is a view or merged table. columnPropertiesJsonSchema string Default JSON schema for validating all JSON column properties. writable columns[] list Columns in the table. writable description string Description assigned to the table. writable isExportable boolean Variable for whether table is exportable. writable kind string The kind of item this is. For table, this is always fusiontables#table. name string Name assigned to a table. writable sql string SQL that encodes the table definition for derived tables. tableId string Encrypted unique alphanumeric identifier for the table. tablePropertiesJson string JSON object containing custom table properties. writable tablePropertiesJsonSchema string JSON schema for validating the JSON table properties.



23
24
25
26
27
28
29
30
31
# File 'lib/fusion_tables_v2.rb', line 23

def self.build(is_exportable: false, name:, db:)
  new_table = new
  new_table.db = db
  new_table.name = name
  new_table.columns = []
  new_table.kind = 'fusiontables#table'
  new_table.is_exportable = is_exportable
  new_table
end

Instance Method Details

#datetime(column_name) ⇒ Object



39
40
41
42
# File 'lib/fusion_tables_v2.rb', line 39

def datetime(column_name)
  columns << db.build_column(name: column_name, type: 'DATETIME', table: self)
  self
end

#integer(column_name) ⇒ Object



44
45
46
47
# File 'lib/fusion_tables_v2.rb', line 44

def integer(column_name)
  columns << db.build_column(name: column_name, type: 'NUMBER', table: self)
  self
end

#location(column_name) ⇒ Object



49
50
51
52
# File 'lib/fusion_tables_v2.rb', line 49

def location(column_name)
  columns << db.build_column(name: column_name, type: 'LOCATION', table: self)
  self
end

#string(column_name) ⇒ Object



33
34
35
36
37
# File 'lib/fusion_tables_v2.rb', line 33

def string(column_name)
  puts db
  columns << db.build_column(name: column_name, type: 'STRING', table: self)
  self
end