Class: Pupa::Processor::Connection
- Inherits:
-
Object
- Object
- Pupa::Processor::Connection
- Defined in:
- lib/pupa/processor/connection.rb,
lib/pupa/processor/connection_adapters/mongodb_adapter.rb,
lib/pupa/processor/connection_adapters/postgresql_adapter.rb
Overview
A database system connection factory.
Defined Under Namespace
Classes: MongoDBAdapter, PostgreSQLAdapter
Class Method Summary collapse
-
.new(database_url) ⇒ Object
Returns a configured connection to a database system.
Class Method Details
.new(database_url) ⇒ Object
Returns a configured connection to a database system.
See each connection adapter for more information.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pupa/processor/connection.rb', line 14 def self.new(database_url) case URI.parse(database_url).scheme when 'postgres', 'sqlite' PostgreSQLAdapter.new(database_url) when 'mongodb' MongoDBAdapter.new(database_url) else raise NotImplementedError end end |