Class: PgDice::PartitionListerFactory
- Inherits:
-
Object
- Object
- PgDice::PartitionListerFactory
- Extended by:
- Forwardable
- Defined in:
- lib/pgdice/partition_lister_factory.rb
Overview
PartitionListerFactory is a class used to build PartitionListers
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration, opts = {}) ⇒ PartitionListerFactory
constructor
A new instance of PartitionListerFactory.
Constructor Details
#initialize(configuration, opts = {}) ⇒ PartitionListerFactory
Returns a new instance of PartitionListerFactory.
11 12 13 14 15 16 |
# File 'lib/pgdice/partition_lister_factory.rb', line 11 def initialize(configuration, opts = {}) @configuration = configuration @query_executor = opts[:query_executor] ||= lambda do |sql| database_connection.execute(sql).values.flatten end end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/pgdice/partition_lister_factory.rb', line 18 def call PgDice::PartitionLister.new(query_executor: @query_executor) end |