Sha256: 71f7ba8342db55aa569138063cb6e90976b69aec601eb487d3aa0a8aa128510a
Contents?: true
Size: 774 Bytes
Versions: 12
Compression:
Stored size: 774 Bytes
Contents
require 'pupa/processor/connection_adapters/mongodb_adapter' require 'pupa/processor/connection_adapters/postgresql_adapter' module Pupa class Processor # A database system connection factory. class Connection # Returns a configured connection to a database system. # # See each connection adapter for more information. # # @param [String] database_url the database URL # @return a configured connection to a database system def self.new(database_url) case URI.parse(database_url).scheme when 'postgres' PostgreSQLAdapter.new(database_url) when 'mongodb' MongoDBAdapter.new(database_url) else raise NotImplementedError end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems