Class: BigShift::InsertRowsCommand

Inherits:
BaseTableCommand show all
Defined in:
lib/big_shift/commands/insert_rows_command.rb

Instance Attribute Summary

Attributes inherited from BaseTableCommand

#table_id

Instance Method Summary collapse

Methods inherited from BaseCommand

execute, #execute

Constructor Details

#initialize(table_name, rows) ⇒ InsertRowsCommand

Returns a new instance of InsertRowsCommand.



3
4
5
6
# File 'lib/big_shift/commands/insert_rows_command.rb', line 3

def initialize(table_name, rows)
  self.table_id = table_name
  @rows         = rows
end

Instance Method Details

#bodyObject



16
17
18
# File 'lib/big_shift/commands/insert_rows_command.rb', line 16

def body
  { :rows => build_rows }
end

#endpointObject



12
13
14
# File 'lib/big_shift/commands/insert_rows_command.rb', line 12

def endpoint
  'insertAll'
end

#on_executeObject



8
9
10
# File 'lib/big_shift/commands/insert_rows_command.rb', line 8

def on_execute
  InsertRowsResponse.new post
end