File: result.rb

package info (click to toggle)
ruby-dataobjects 0.10.8-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 416 kB
  • sloc: ruby: 2,917; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module DataObjects
  # The Result class is returned from Connection#execute_non_query.
  class Result
    # The ID of a row inserted by the Command
    attr_accessor :insert_id
    # The number of rows affected by the Command
    attr_accessor :affected_rows

    # Create a new Result. Used internally in the adapters.
    def initialize(command, affected_rows, insert_id = nil)
      @command, @affected_rows, @insert_id = command, affected_rows, insert_id
    end

    # Return the number of affected rows
    def to_i
      @affected_rows
    end
  end
end