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 ⇒ 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 = keys || (0..(values.size - 1)).collect{|i| "column#{i}"} end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 |
# File 'lib/clickhouse/connection/query/result_row.rb', line 11 def to_hash @hash ||= Hash[@keys.zip(self)] end |