Class: Cql::Client::VoidResult
- Inherits:
-
Object
- Object
- Cql::Client::VoidResult
- Includes:
- Enumerable
- Defined in:
- lib/cql/client/void_result.rb
Overview
Many CQL queries do not return any rows, but they can still return data about the query, for example the trace ID. This class exist to make that data available.
It has the exact same API as QueryResult so that you don't need to check the return value of for example Client#execute.
Constant Summary collapse
- INSTANCE =
self.new
Instance Attribute Summary collapse
- #metadata ⇒ ResultMetadata readonly
-
#trace_id ⇒ Cql::Uuid
readonly
The ID of the query trace associated with the query, if any.
Instance Method Summary collapse
-
#each(&block) ⇒ Enumerable
(also: #each_row)
No-op for API compatibility with QueryResult.
-
#empty? ⇒ Boolean
Always returns true.
-
#last_page? ⇒ Boolean
Always returns true.
-
#next_page ⇒ Object
Always returns nil.
Instance Attribute Details
#metadata ⇒ ResultMetadata (readonly)
21 22 23 |
# File 'lib/cql/client/void_result.rb', line 21 def @metadata end |
#trace_id ⇒ Cql::Uuid (readonly)
The ID of the query trace associated with the query, if any.
26 27 28 |
# File 'lib/cql/client/void_result.rb', line 26 def trace_id @trace_id end |
Instance Method Details
#each(&block) ⇒ Enumerable Also known as: each_row
No-op for API compatibility with QueryResult.
52 53 54 |
# File 'lib/cql/client/void_result.rb', line 52 def each(&block) self end |
#empty? ⇒ Boolean
Always returns true
35 36 37 |
# File 'lib/cql/client/void_result.rb', line 35 def empty? true end |
#last_page? ⇒ Boolean
Always returns true
40 41 42 |
# File 'lib/cql/client/void_result.rb', line 40 def last_page? true end |
#next_page ⇒ Object
Always returns nil
45 46 47 |
# File 'lib/cql/client/void_result.rb', line 45 def next_page nil end |