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
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) ⇒ QueryResult
constructor
A new instance of QueryResult.
Constructor Details
#initialize(metadata, rows) ⇒ QueryResult
Returns a new instance of QueryResult.
12 13 14 15 |
# File 'lib/cql/client/query_result.rb', line 12 def initialize(, rows) @metadata = ResultMetadata.new() @rows = rows end |
Instance Attribute Details
#metadata ⇒ ResultMetadata (readonly)
9 10 11 |
# File 'lib/cql/client/query_result.rb', line 9 def @metadata end |
Instance Method Details
#each {|row| ... } ⇒ Enumerable<Hash> Also known as: each_row
Iterates over each row in the result set.
28 29 30 |
# File 'lib/cql/client/query_result.rb', line 28 def each(&block) @rows.each(&block) end |
#empty? ⇒ Boolean
Returns whether or not there are any rows in this result set
19 20 21 |
# File 'lib/cql/client/query_result.rb', line 19 def empty? @rows.empty? end |