lib/hanami/providers/db/adapters.rb in hanami-2.2.0.beta1 vs lib/hanami/providers/db/adapters.rb in hanami-2.2.0.beta2
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
module Hanami
module Providers
- class DB < Dry::System::Provider::Source
+ class DB < Hanami::Provider::Source
# @api public
# @since 2.2.0
class Adapters
# @api private
# @since 2.2.0
@@ -17,16 +17,22 @@
def_delegators :adapters, :[], :[]=, :each, :to_h
# @api private
# @since 2.2.0
+ def self.new_adapter(name)
+ ADAPTER_CLASSES[name].new
+ end
+
+ # @api private
+ # @since 2.2.0
attr_reader :adapters
# @api private
# @since 2.2.0
def initialize
@adapters = Hash.new do |hsh, key|
- hsh[key] = ADAPTER_CLASSES[key].new
+ hsh[key] = self.class.new_adapter(key)
end
end
# @api private
# @since 2.2.0