Method: Sequel::Mock::Database#fetch=
- Defined in:
- lib/sequel/adapters/mock.rb
permalink #fetch=(value) ⇒ Object (writeonly)
Set the hashes to yield by execute when retrieving rows. Argument types supported:
- nil
-
Yield no rows
- Hash
-
Always yield a single row with this hash
- Array of Hashes
-
Yield separately for each hash in this array
- Array (otherwise)
-
First retrieval gets the first value in the array, second gets the second value, etc.
- Proc
-
Called with the select SQL query, uses the value returned, which should be a hash or array of hashes.
- Class
-
Should be an Exception subclass, will create a new instance an raise it wrapped in a DatabaseError.
82 83 84 |
# File 'lib/sequel/adapters/mock.rb', line 82 def fetch=(value) @fetch = value end |