Class: DataObjects::Result
- Inherits:
-
Object
- Object
- DataObjects::Result
- Defined in:
- lib/data_objects/result.rb
Overview
The Result class is returned from Connection#execute_non_query.
Instance Attribute Summary collapse
-
#affected_rows ⇒ Object
The number of rows affected by the Command.
-
#insert_id ⇒ Object
The ID of a row inserted by the Command.
Instance Method Summary collapse
-
#initialize(command, affected_rows, insert_id = nil) ⇒ Result
constructor
Create a new Result.
-
#to_i ⇒ Object
Return the number of affected rows.
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_rows ⇒ Object
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_id ⇒ Object
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_i ⇒ Object
Return the number of affected rows
15 16 17 |
# File 'lib/data_objects/result.rb', line 15 def to_i @affected_rows end |