Class: ActiveShard::ActiveRecord::ConnectionHandler::ConnectionPoolHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/active_shard/active_record/connection_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection_handler) ⇒ ConnectionPoolHash

Returns a new instance of ConnectionPoolHash.



146
147
148
# File 'lib/active_shard/active_record/connection_handler.rb', line 146

def initialize( connection_handler )
  @connection_handler = connection_handler
end

Instance Method Details

#[](val) ⇒ Object



150
151
152
153
154
155
156
157
# File 'lib/active_shard/active_record/connection_handler.rb', line 150

def [](val)
  case val
  when PoolKey
    super
  else
    @connection_handler.retrieve_connection_pool( val.constantize )
  end
end