lib/data_objects/reader.rb in data_objects-0.9.11 vs lib/data_objects/reader.rb in data_objects-0.9.12
- old
+ new
@@ -1,29 +1,30 @@
module DataObjects
+ # Abstract class to read rows from a query result
class Reader
+ # Return the array of field names
def fields
raise NotImplementedError.new
end
+ # Return the array of field values for the current row. Not legal after next! has returned false or before it's been called
def values
raise NotImplementedError.new
end
+ # Close the reader discarding any unread results.
def close
raise NotImplementedError.new
end
- # Moves the cursor forward.
+ # Discard the current row (if any) and read the next one (returning true), or return nil if there is no further row.
def next!
raise NotImplementedError.new
end
+ # Return the number of fields in the result set.
def field_count
- raise NotImplementedError.new
- end
-
- def row_count
raise NotImplementedError.new
end
end
end