Class: ActiveCypher::ConnectionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/active_cypher/connection_handler.rb

Instance Method Summary collapse

Constructor Details

#initializeConnectionHandler

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

Parameters:

  • db_key (Symbol)

    The database key (e.g., :primary, :neo4j)

Returns:



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

Parameters:

  • db_key (Symbol)

    The database key (e.g., :primary, :neo4j)

  • pool (ConnectionPool)

    The 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