Class: Cql::Client::ResultMetadata
- Inherits:
-
Object
- Object
- Cql::Client::ResultMetadata
- Includes:
- Enumerable
- Defined in:
- lib/cql/client/result_metadata.rb
Instance Method Summary collapse
-
#[](column_name) ⇒ ColumnMetadata
Returns the column metadata.
-
#each {|metadata| ... } ⇒ Enumerable<ColumnMetadata>
Iterates over the metadata for each column.
-
#initialize(metadata) ⇒ ResultMetadata
constructor
A new instance of ResultMetadata.
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
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
26 27 28 |
# File 'lib/cql/client/result_metadata.rb', line 26 def each(&block) @metadata.each_value(&block) end |