Class: DataObjects::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/data_objects/result.rb

Overview

The Result class is returned from Connection#execute_non_query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, affected_rows, insert_id = nil) ⇒ Result

Create a new Result. Used internally in the adapters.



10
11
12
# File 'lib/data_objects/result.rb', line 10

def initialize(command, affected_rows, insert_id = nil)
  @command, @affected_rows, @insert_id = command, affected_rows, insert_id
end

Instance Attribute Details

#affected_rowsObject

The number of rows affected by the Command



7
8
9
# File 'lib/data_objects/result.rb', line 7

def affected_rows
  @affected_rows
end

#insert_idObject

The ID of a row inserted by the Command



5
6
7
# File 'lib/data_objects/result.rb', line 5

def insert_id
  @insert_id
end

Instance Method Details

#to_iObject

Return the number of affected rows



15
16
17
# File 'lib/data_objects/result.rb', line 15

def to_i
  @affected_rows
end