class DbCharmer::ConnectionProxy

Constants

DOESNT_RESPOND_TO_METHODS

Short-circuit some of the methods for which we know there is a separate check in coercion code

RESPOND_TO_METHODS

Attributes

abstract_connection_class[RW]

We use this to get a connection class from the proxy

Public Class Methods

new(abstract_class, db_name) click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 10
def initialize(abstract_class, db_name)
  @abstract_connection_class = abstract_class
  @db_name = db_name
end

Public Instance Methods

db_charmer_connection_name() click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 15
def db_charmer_connection_name
  @db_name
end
db_charmer_connection_proxy() click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 19
def db_charmer_connection_proxy
  self
end
db_charmer_retrieve_connection() click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 23
def db_charmer_retrieve_connection
  @abstract_connection_class.retrieve_connection
end
method_missing(meth, *args, &block) click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 52
def method_missing(meth, *args, &block)
  db_charmer_retrieve_connection.send(meth, *args, &block)
end
nil?() click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 27
def nil?
  false
end
respond_to?(method_name, include_all = false) click to toggle source
# File lib/db_charmer/connection_proxy.rb, line 45
def respond_to?(method_name, include_all = false)
  return true if RESPOND_TO_METHODS.include?(method_name)
  return false if DOESNT_RESPOND_TO_METHODS.include?(method_name)
  db_charmer_retrieve_connection.respond_to?(method_name, include_all)
end