Module: Daodalus::Connection

Extended by:
Connection
Included in:
Connection
Defined in:
lib/daodalus/connection.rb

Instance Method Summary collapse

Instance Method Details

#connectionsObject



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