Class: Turboquery::TableMover

Inherits:
Object
  • Object
show all
Defined in:
lib/turboquery/table_mover.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, destination:, from_table:, to_table:) ⇒ TableMover

Returns a new instance of TableMover.



5
6
7
8
9
10
# File 'lib/turboquery/table_mover.rb', line 5

def initialize(source:, destination:, from_table:, to_table:)
  self.source = source
  self.destination = destination
  self.from_table = from_table
  self.to_table = to_table
end

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



3
4
5
# File 'lib/turboquery/table_mover.rb', line 3

def destination
  @destination
end

#from_tableObject

Returns the value of attribute from_table.



3
4
5
# File 'lib/turboquery/table_mover.rb', line 3

def from_table
  @from_table
end

#sourceObject

Returns the value of attribute source.



3
4
5
# File 'lib/turboquery/table_mover.rb', line 3

def source
  @source
end

#to_tableObject

Returns the value of attribute to_table.



3
4
5
# File 'lib/turboquery/table_mover.rb', line 3

def to_table
  @to_table
end

Instance Method Details

#moveObject



12
13
14
15
16
# File 'lib/turboquery/table_mover.rb', line 12

def move
  create_destination unless destination_exists?
  key = copy_source_to_s3
  copy_s3_to_destination(key)
end