Class: Daru::IO::SqlDataSource::Adapter
- Defined in:
- lib/daru/io/sql_data_source.rb
Instance Method Summary collapse
-
#initialize(conn, query) ⇒ Adapter
constructor
A new instance of Adapter.
- #result_hash ⇒ Object
Constructor Details
#initialize(conn, query) ⇒ Adapter
Returns a new instance of Adapter.
6 7 8 9 |
# File 'lib/daru/io/sql_data_source.rb', line 6 def initialize(conn, query) @conn = conn @query = query end |
Instance Method Details
#result_hash ⇒ Object
11 12 13 14 15 16 |
# File 'lib/daru/io/sql_data_source.rb', line 11 def result_hash column_names .map(&:to_sym) .zip(rows.transpose) .to_h end |