Sha256: a1d480446771e24be9ebfc0bfcb0f500bf17e892f913d50627dec68bddbfb32c

Contents?: true

Size: 511 Bytes

Versions: 9

Compression:

Stored size: 511 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 db_charmer_connection_proxy
      self
    end

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
db-charmer-1.7.0.pre1 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.19 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.18 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.17 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.16 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.15 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.14 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.13 lib/db_charmer/connection_proxy.rb
db-charmer-1.6.12 lib/db_charmer/connection_proxy.rb