Module: DB::Adapters

Defined in:
lib/db/adapters.rb

Overview

A global map of registered adapters. e.g. `DB::Adapters.register(:mariadb, DB::MariaDB::Adapter)`

Class Method Summary collapse

Class Method Details

.each(&block) ⇒ Object

Enumerate all registered adapters.


41
42
43
# File 'lib/db/adapters.rb', line 41

def self.each(&block)
	@adapters.each(&block)
end

.register(name, adapter) ⇒ Object

Register the adapter class to the specified name.


32
33
34
# File 'lib/db/adapters.rb', line 32

def self.register(name, adapter)
	@adapters[name] = adapter
end