Class: NusaDB::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/nusadb/connection.rb

Overview

A prepared statement handle.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, name) ⇒ Statement

Returns a new instance of Statement.



528
529
530
531
# File 'lib/nusadb/connection.rb', line 528

def initialize(connection, name)
  @connection = connection
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



526
527
528
# File 'lib/nusadb/connection.rb', line 526

def name
  @name
end

Instance Method Details

#execute(params = []) ⇒ Object



533
534
535
# File 'lib/nusadb/connection.rb', line 533

def execute(params = [])
  @connection.run_prepared(@name, params)
end