Class: Runivedo::Statement

Inherits:
RemoteObject show all
Includes:
RemoteObject::MethodMissing
Defined in:
lib/runivedo/sql.rb

Constant Summary

Constants inherited from RemoteObject

RemoteObject::OPERATION_ANSWER_CALL, RemoteObject::OPERATION_CALL_ROM, RemoteObject::OPERATION_DELETE, RemoteObject::OPERATION_NOTIFY

Instance Method Summary collapse

Methods included from RemoteObject::MethodMissing

#method_missing

Methods inherited from RemoteObject

#call_rom, #close, #closed?, #on, #send_notification

Constructor Details

#initialize(*args) ⇒ Statement

Returns a new instance of Statement.



6
7
8
9
10
11
12
# File 'lib/runivedo/sql.rb', line 6

def initialize(*args)
  super(*args)
  @column_names = Future.new
  @column_types = Future.new
  on('setColumnNames') {|cols| @column_names.complete(cols)}
  on('setColumnTypes') {|types| @column_types.complete(types)}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Runivedo::RemoteObject::MethodMissing

Instance Method Details

#column_namesObject



14
15
16
# File 'lib/runivedo/sql.rb', line 14

def column_names
  @column_names.get
end

#column_typesObject



18
19
20
# File 'lib/runivedo/sql.rb', line 18

def column_types
  @column_types.get
end

#execute(binds = {}, &block) ⇒ Object



22
23
24
# File 'lib/runivedo/sql.rb', line 22

def execute(binds = {}, &block)
  call_rom("execute", binds, &block)
end