Class: Turboquery::TableMover
- Inherits:
-
Object
- Object
- Turboquery::TableMover
- Defined in:
- lib/turboquery/table_mover.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#from_table ⇒ Object
Returns the value of attribute from_table.
-
#source ⇒ Object
Returns the value of attribute source.
-
#to_table ⇒ Object
Returns the value of attribute to_table.
Instance Method Summary collapse
-
#initialize(source:, destination:, from_table:, to_table:) ⇒ TableMover
constructor
A new instance of TableMover.
- #move ⇒ Object
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
#destination ⇒ Object
Returns the value of attribute destination.
3 4 5 |
# File 'lib/turboquery/table_mover.rb', line 3 def destination @destination end |
#from_table ⇒ Object
Returns the value of attribute from_table.
3 4 5 |
# File 'lib/turboquery/table_mover.rb', line 3 def from_table @from_table end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/turboquery/table_mover.rb', line 3 def source @source end |
#to_table ⇒ Object
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
#move ⇒ Object
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 |