Class: Cql::Client::QueryResult
- Inherits:
-
Object
- Object
- Cql::Client::QueryResult
- Includes:
- Enumerable
- Defined in:
- lib/cql/client/query_result.rb
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 {|row| ... } ⇒ Enumerable<Hash>
(also: #each_row)
Iterates over each row in the result set.
-
#empty? ⇒ Boolean
Returns whether or not there are any rows in this result set.
-
#initialize(metadata, rows, trace_id) ⇒ QueryResult
constructor
A new instance of QueryResult.
Constructor Details
#initialize(metadata, rows, trace_id) ⇒ QueryResult
Returns a new instance of QueryResult.
17 18 19 20 21 |
# File 'lib/cql/client/query_result.rb', line 17 def initialize(, rows, trace_id) @metadata = ResultMetadata.new() @rows = rows @trace_id = trace_id end |
Instance Attribute Details
#metadata ⇒ ResultMetadata (readonly)
9 10 11 |
# File 'lib/cql/client/query_result.rb', line 9 def @metadata end |
#trace_id ⇒ Cql::Uuid (readonly)
The ID of the query trace associated with the query, if any.
14 15 16 |
# File 'lib/cql/client/query_result.rb', line 14 def trace_id @trace_id end |
Instance Method Details
#each {|row| ... } ⇒ Enumerable<Hash> Also known as: each_row
Iterates over each row in the result set.
32 33 34 |
# File 'lib/cql/client/query_result.rb', line 32 def each(&block) @rows.each(&block) end |
#empty? ⇒ Boolean
Returns whether or not there are any rows in this result set
24 25 26 |
# File 'lib/cql/client/query_result.rb', line 24 def empty? @rows.empty? end |