Class: ActiveCypher::ConnectionHandler
- Inherits:
-
Object
- Object
- ActiveCypher::ConnectionHandler
- Defined in:
- lib/active_cypher/connection_handler.rb
Instance Method Summary collapse
-
#initialize ⇒ ConnectionHandler
constructor
A new instance of ConnectionHandler.
-
#pool(db_key) ⇒ ConnectionPool?
Get a connection pool.
-
#set(db_key, pool) ⇒ Object
Set a connection pool.
Constructor Details
#initialize ⇒ ConnectionHandler
Returns a new instance of ConnectionHandler.
5 6 7 8 |
# File 'lib/active_cypher/connection_handler.rb', line 5 def initialize # One-level hash: db_key -> pool @db_key_map = {} end |
Instance Method Details
#pool(db_key) ⇒ ConnectionPool?
Get a connection pool
20 21 22 |
# File 'lib/active_cypher/connection_handler.rb', line 20 def pool(db_key) @db_key_map[db_key.to_sym] end |
#set(db_key, pool) ⇒ Object
Set a connection pool
13 14 15 |
# File 'lib/active_cypher/connection_handler.rb', line 13 def set(db_key, pool) @db_key_map[db_key.to_sym] = pool end |