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