Class: ROM::Yesql::Dataset Private
- Inherits:
-
Object
- Object
- ROM::Yesql::Dataset
- Defined in:
- lib/rom/yesql/dataset.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Yesql dataset simply uses a sequel connection to fetch results of a query
Instance Attribute Summary collapse
- #connection ⇒ Sequel::Database readonly private
Instance Method Summary collapse
-
#initialize(connection) ⇒ Dataset
constructor
private
A new instance of Dataset.
-
#read(query) ⇒ Array<Hash>
private
Fetch results of a query using sequel connection.
Constructor Details
#initialize(connection) ⇒ Dataset
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Dataset.
15 16 17 |
# File 'lib/rom/yesql/dataset.rb', line 15 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Sequel::Database (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/rom/yesql/dataset.rb', line 12 def connection @connection end |
Instance Method Details
#read(query) ⇒ Array<Hash>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Fetch results of a query using sequel connection
24 25 26 |
# File 'lib/rom/yesql/dataset.rb', line 24 def read(query) connection.fetch(query) end |