Class: Cql::Client::VoidResult

Inherits:
Object
  • Object
show all
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.

See Also:

Constant Summary collapse

INSTANCE =
self.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metadataResultMetadata (readonly)

Returns:



21
22
23
# File 'lib/cql/client/void_result.rb', line 21

def 
  @metadata
end

#trace_idCql::Uuid (readonly)

The ID of the query trace associated with the query, if any.

Returns:



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.

Returns:

  • (Enumerable)


52
53
54
# File 'lib/cql/client/void_result.rb', line 52

def each(&block)
  self
end

#empty?Boolean

Always returns true

Returns:

  • (Boolean)


35
36
37
# File 'lib/cql/client/void_result.rb', line 35

def empty?
  true
end

#last_page?Boolean

Always returns true

Returns:

  • (Boolean)


40
41
42
# File 'lib/cql/client/void_result.rb', line 40

def last_page?
  true
end

#next_pageObject

Always returns nil



45
46
47
# File 'lib/cql/client/void_result.rb', line 45

def next_page
  nil
end