Class: Clickhouse::Connection::Query::ResultRow
- Inherits:
-
Array
- Object
- Array
- Clickhouse::Connection::Query::ResultRow
- Defined in:
- lib/clickhouse/connection/query/result_row.rb
Instance Method Summary collapse
-
#initialize(values = [], keys = nil) ⇒ ResultRow
constructor
A new instance of ResultRow.
- #to_hash(symbolize = false) ⇒ Object
Constructor Details
#initialize(values = [], keys = nil) ⇒ ResultRow
Returns a new instance of ResultRow.
6 7 8 9 |
# File 'lib/clickhouse/connection/query/result_row.rb', line 6 def initialize(values = [], keys = nil) super values @keys = normalize_keys(keys) end |
Instance Method Details
#to_hash(symbolize = false) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/clickhouse/connection/query/result_row.rb', line 11 def to_hash(symbolize = false) @hash ||= begin keys = symbolize ? @keys.collect(&:to_sym) : @keys Hash[keys.zip(self)] end end |