Class: RedshiftExtractor::Drop

Inherits:
Object
  • Object
show all
Defined in:
lib/redshift_extractor/drop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Drop

Returns a new instance of Drop.



5
6
7
8
# File 'lib/redshift_extractor/drop.rb', line 5

def initialize(args)
  @destination_schema = args.fetch(:destination_schema)
  @destination_table = args.fetch(:destination_table)
end

Instance Attribute Details

#destination_schemaObject (readonly)

Returns the value of attribute destination_schema.



3
4
5
# File 'lib/redshift_extractor/drop.rb', line 3

def destination_schema
  @destination_schema
end

#destination_tableObject (readonly)

Returns the value of attribute destination_table.



3
4
5
# File 'lib/redshift_extractor/drop.rb', line 3

def destination_table
  @destination_table
end

Instance Method Details

#drop_sqlObject



10
11
12
# File 'lib/redshift_extractor/drop.rb', line 10

def drop_sql
  "drop table if exists #{destination_schema}.#{destination_table};"
end