Class: Preserves::SQL::ResultSet
- Inherits:
-
Object
- Object
- Preserves::SQL::ResultSet
- Includes:
- Enumerable
- Defined in:
- lib/preserves/sql/result_set.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(pg_result) ⇒ ResultSet
constructor
A new instance of ResultSet.
- #size ⇒ Object
Constructor Details
#initialize(pg_result) ⇒ ResultSet
Returns a new instance of ResultSet.
7 8 9 |
# File 'lib/preserves/sql/result_set.rb', line 7 def initialize(pg_result) @pg_result = pg_result end |
Instance Method Details
#each(&block) ⇒ Object
15 16 17 |
# File 'lib/preserves/sql/result_set.rb', line 15 def each(&block) @pg_result.each(&block) end |
#size ⇒ Object
11 12 13 |
# File 'lib/preserves/sql/result_set.rb', line 11 def size @pg_result.ntuples == 0 ? @pg_result.cmd_tuples : @pg_result.ntuples end |