Class: BigShift::CreateTableCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- BigShift::CreateTableCommand
- Defined in:
- lib/big_shift/commands/create_table_command.rb
Instance Method Summary collapse
- #body ⇒ Object
- #endpoint ⇒ Object
-
#initialize(schema) ⇒ CreateTableCommand
constructor
A new instance of CreateTableCommand.
- #on_execute ⇒ Object
Methods inherited from BaseCommand
Constructor Details
#initialize(schema) ⇒ CreateTableCommand
Returns a new instance of CreateTableCommand.
3 4 5 |
# File 'lib/big_shift/commands/create_table_command.rb', line 3 def initialize(schema) @schema = schema end |
Instance Method Details
#body ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/big_shift/commands/create_table_command.rb', line 15 def body { 'tableReference' => { 'projectId' => project_id, 'datasetId' => dataset_id, 'tableId' => @schema.table_name, }, 'schema' => @schema, } end |
#endpoint ⇒ Object
11 12 13 |
# File 'lib/big_shift/commands/create_table_command.rb', line 11 def endpoint 'tables' end |
#on_execute ⇒ Object
7 8 9 |
# File 'lib/big_shift/commands/create_table_command.rb', line 7 def on_execute CreateTableResponse.new post end |