Class: Gateway::CassandraCQL

Inherits:
Base
  • Object
show all
Defined in:
lib/gateway-cassandra-cql.rb

Instance Method Summary collapse

Instance Method Details

#__execute__Object



25
# File 'lib/gateway-cassandra-cql.rb', line 25

alias :__execute__ :execute

#execute(*args) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gateway-cassandra-cql.rb', line 27

def execute *args
  arguments = args.dup
  statement = args.shift
  block = args.pop if block_given?
  opts = args.last.is_a?(Hash) ? args.pop : {}
  bind_vars = args

  __execute__('cql', statement.to_s, opts) do |conn|
    if block
      conn.execute statement, *bind_vars, &block
    else
      conn.execute statement, *bind_vars
    end
  end
end