Class: Daru::IO::SqlDataSource
Defined Under Namespace
Classes: Adapter
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(db, query) ⇒ SqlDataSource
constructor
A new instance of SqlDataSource.
- #make_dataframe ⇒ Object
Constructor Details
#initialize(db, query) ⇒ SqlDataSource
Returns a new instance of SqlDataSource.
62 63 64 |
# File 'lib/daru/io/sql_data_source.rb', line 62 def initialize(db, query) @adapter = init_adapter(db, query) end |
Class Method Details
.make_dataframe(db, query) ⇒ Object
58 59 60 |
# File 'lib/daru/io/sql_data_source.rb', line 58 def self.make_dataframe(db, query) new(db, query).make_dataframe end |
Instance Method Details
#make_dataframe ⇒ Object
66 67 68 |
# File 'lib/daru/io/sql_data_source.rb', line 66 def make_dataframe Daru::DataFrame.new(@adapter.result_hash).tap(&:update) end |