Class: PgDice::PartitionHelperFactory

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

Overview

PartitionManagerFactory is a class used to build PartitionManagers

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PartitionHelperFactory.



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

def initialize(configuration, opts = {})
  @configuration = configuration
  @validation_factory = opts[:validation_factory] ||= PgDice::ValidationFactory.new(configuration)
  @pg_slice_manager_factory = opts[:pg_slice_manager_factory] ||= PgDice::PgSliceManagerFactory.new(configuration)
end

Instance Method Details

#callObject



17
18
19
20
21
22
# File 'lib/pgdice/partition_helper_factory.rb', line 17

def call
  PgDice::PartitionHelper.new(logger: logger,
                              approved_tables: approved_tables,
                              validation: @validation_factory.call,
                              pg_slice_manager: @pg_slice_manager_factory.call)
end