I've extracted some cross-cutting concerns such as getting a database connection, logging and application configuration into separate modules in my Ruby application. I can include them in classes that require those services. So far, so good.

My problem is that the database connection module requires logging and application configuration functionality, so ideally I'd like it to make use of the existing modules that provide these services, but I don't know how to achieve this. As you can see below, at the moment the code in the database connection module isn't very DRY.

**connection.rb**

```
module Connection
  def connection
    Connection.connection
  end

  def self.connection
    @connection ||= begin

      # Should use Configuration module here
      config = YAML.load_file(File.join(__dir__, 'config.yml'))
      @connection = Mysql2::Client.new(config['database'])
      @connection.query_options.merge!(symbolize_keys: true)
      @connection
    rescue Mysql2::Error => err

      # Should use Logging module here
      logger = Logger.new($stdout)
      logger.error "MySQL error: #{err}"
      exit(1)
    end
  end
end

```

**configuration.rb**

```
module Configuration
  def config
    Configuration.config
  end

  def self.config
    @config ||= YAML.load_file(File.join(__dir__, 'config.yml'))
  end
end

```

**logging.rb**

```
module Logging
  def logger
    Logging.logger
  end

  def self.logger
    @logger ||= Logger.new($stdout)
  end
end

```

Is there a way for my database connection module to be able to use the methods provided by the other two modules?