Module: Daodalus::Connection
Instance Method Summary collapse
- #connections ⇒ Object
- #fetch(name = 'default') ⇒ Object
- #register(connection, name = 'default') ⇒ Object
Instance Method Details
#connections ⇒ Object
14 15 16 |
# File 'lib/daodalus/connection.rb', line 14 def connections @connections ||= {} end |
#fetch(name = 'default') ⇒ Object
10 11 12 |
# File 'lib/daodalus/connection.rb', line 10 def fetch(name='default') connections.fetch(name.to_s) { raise InvalidConnectionError.new(name) } end |
#register(connection, name = 'default') ⇒ Object
6 7 8 |
# File 'lib/daodalus/connection.rb', line 6 def register(connection, name='default') connections[name.to_s] = connection end |