Class: Cql::Client::ResultMetadata

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/cql/client/result_metadata.rb

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ ResultMetadata

Returns a new instance of ResultMetadata.



9
10
11
# File 'lib/cql/client/result_metadata.rb', line 9

def initialize()
  @metadata = .each_with_object({}) { |m, h| h[m[2]] = ColumnMetadata.new(*m) }
end

Instance Method Details

#[](column_name) ⇒ ColumnMetadata

Returns the column metadata

Returns:



17
18
19
# File 'lib/cql/client/result_metadata.rb', line 17

def [](column_name)
  @metadata[column_name]
end

#each {|metadata| ... } ⇒ Enumerable<ColumnMetadata>

Iterates over the metadata for each column

Yield Parameters:

Returns:



26
27
28
# File 'lib/cql/client/result_metadata.rb', line 26

def each(&block)
  @metadata.each_value(&block)
end