Sha256: 0aca88d12acb0a1c2e8c584bfcafe69ab0b3fe53efb1caa1905b6395d8844a56
Contents?: true
Size: 602 Bytes
Versions: 15
Compression:
Stored size: 602 Bytes
Contents
module DbCharmer module Sharding autoload :Connection, 'db_charmer/sharding/connection' autoload :StubConnection, 'db_charmer/sharding/stub_connection' autoload :Method, 'db_charmer/sharding/method' @@sharded_connections = {} def self.register_connection(config) name = config[:name] or raise ArgumentError, "No :name in connection!" @@sharded_connections[name] = DbCharmer::Sharding::Connection.new(config) end def self.sharded_connection(name) @@sharded_connections[name] or raise ArgumentError, "Invalid sharded connection name!" end end end
Version data entries
15 entries across 15 versions & 2 rubygems