lib/makara/connection_wrapper.rb
# once the underlying connection is present we must evaluate extra functionality into it.
# all extra functionality is in the format of _makara*
once the underlying connection is present we must evaluate extra functionality into it.
all extra functionality is in the format of _makara
once the underlying connection is present we must evaluate extra functionality into it . all extra functionality is in the format of _makara
def _makara_decorate_connection(con)
      extension = %Q{
        # the proxy object controlling this connection
        def _makara
          @_makara
        end
        def _makara=(m)
          @_makara = m
        end
        # if the proxy has already decided the correct connection to use, yield nil.
        # if the proxy has yet to decide, yield the proxy
        def _makara_hijack
          if _makara.hijacked?
            yield nil
          else
            yield _makara
          end
        end
        # for logging, errors, and debugging
        def _makara_name
          #{@config[:name].inspect}
        end
      }
      @proxy.class.hijack_methods.each do |meth|
        extension << %Q{
          def #{meth}(*args, &block)
            _makara_hijack do |proxy|
              if proxy
                proxy.#{meth}(*args, &block)
              else
                super
              end
            end
          end
        }
      end
      con.instance_eval(extension)
      con._makara = @proxy
      con._makara
    end
def _makara_decorate_connection ( con ) extension = %Q{
        # the proxy object controlling this connection
        def _makara
          @_makara
        end

        def _makara=(m)
          @_makara = m
        end

        # if the proxy has already decided the correct connection to use, yield nil.
        # if the proxy has yet to decide, yield the proxy
        def _makara_hijack
          if _makara.hijacked?
            yield nil
          else
            yield _makara
          end
        end

        # for logging, errors, and debugging
        def _makara_name
          #{@config[:name].inspect}
        end
      } @proxy . class . hijack_methods . each do | meth | extension << %Q{
          def #{meth}(*args, &block)
            _makara_hijack do |proxy|
              if proxy
                proxy.#{meth}(*args, &block)
              else
                super
              end
            end
          end
        } end con . instance_eval ( extension ) con . _makara = @proxy con . _makara end
once the underlying connection is present we must evaluate extra functionality into it.
once the underlying connection is present we must evaluate extra functionality into it .
# Each method the Makara::Proxy needs to hijack should be redefined in the underlying connection. # The new definition should allow for the proxy to intercept the invocation if required. # extend the instance # set the makara context
con
<not_specific>