Class: BigShift::CreateTableCommand

Inherits:
BaseCommand show all
Defined in:
lib/big_shift/commands/create_table_command.rb

Class Method Summary collapse

Class Method Details

.bodyObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/big_shift/commands/create_table_command.rb', line 13

def body
  {
    'tableReference' => {
      'projectId' => project_id,
      'datasetId' => dataset_id,
      'tableId'   => @schema.table_name,
    },

    'schema' => @schema,
  }
end

.endpointObject



9
10
11
# File 'lib/big_shift/commands/create_table_command.rb', line 9

def endpoint
  'tables'
end

.execute(schema) ⇒ Object



4
5
6
7
# File 'lib/big_shift/commands/create_table_command.rb', line 4

def execute(schema)
  @schema = schema
  CreateTableResponse.new post
end