module Adapters
A global map of registered adapters.
e.g. DB::Adapters.register(:mariadb, DB::MariaDB::Adapter)
Definitions
def self.register(name, adapter)
Register the adapter class to the specified name.
Signature
-
parameter
name
Symbol
The adapter name.
-
parameter
adapter
Class
The adapter class.
Implementation
def self.register(name, adapter)
@adapters[name] = adapter
end
def self.each(&block)
Enumerate all registered adapters.
Signature
-
yields
{|name, adapter| ...}
The adapters if a block is given.
-
parameter
name
Symbol
The adapter name.
-
parameter
adapter
Class
The adapter class
-
parameter
-
returns
Enumerator(Symbol, Class)
If no block is given.
Implementation
def self.each(&block)
@adapters.each(&block)
end