Class: PgDice::PartitionDropperFactory

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pgdice/partition_dropper_factory.rb

Overview

PartitionListerFactory is a class used to build PartitionListers

Instance Method Summary collapse

Constructor Details

#initialize(configuration, opts = {}) ⇒ PartitionDropperFactory

Returns a new instance of PartitionDropperFactory.



11
12
13
14
# File 'lib/pgdice/partition_dropper_factory.rb', line 11

def initialize(configuration, opts = {})
  @configuration = configuration
  @query_executor = opts[:query_executor] ||= ->(sql) { database_connection.execute(sql) }
end

Instance Method Details

#callObject



16
17
18
# File 'lib/pgdice/partition_dropper_factory.rb', line 16

def call
  PgDice::PartitionDropper.new(logger: logger, query_executor: @query_executor)
end