Class: Arproxy::ProxyChainTail

Inherits:
Proxy
  • Object
show all
Defined in:
lib/arproxy/proxy_chain_tail.rb

Instance Attribute Summary

Attributes inherited from Proxy

#context, #next_proxy

Instance Method Summary collapse

Instance Method Details

#execute(sql, context) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/arproxy/proxy_chain_tail.rb', line 6

def execute(sql, context)
  unless context.instance_of?(QueryContext)
    raise Arproxy::Error, "`context` is expected a `Arproxy::QueryContext` but got `#{context.class}`"
  end

  if context.with_binds?
    context.raw_connection.send(context.execute_method_name, sql, context.name, context.binds, **context.kwargs)
  else
    context.raw_connection.send(context.execute_method_name, sql, context.name, **context.kwargs)
  end
end