Sha256: 1aaa1a44a54723c9ecfb81406c4bb8de610b2b885b0b3c1de6443b4b1aea33f8

Contents?: true

Size: 455 Bytes

Versions: 12

Compression:

Stored size: 455 Bytes

Contents

# Simple proxy that sends all method calls to a real database connection
module DbCharmer
  class ConnectionProxy < BlankSlate
    def initialize(abstract_class, db_name)
      @abstract_connection_class = abstract_class
      @db_name = db_name
    end

    def db_charmer_connection_name
      @db_name
    end

    def method_missing(meth, *args, &block)
      @abstract_connection_class.retrieve_connection.send(meth, *args, &block)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
db-charmer-1.6.11 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.10 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.9 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.8 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.7 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.6 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.5 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.4 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.3 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.2 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.1 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.0 lib/db_charmer/connection_proxy.rb