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.
13 14 15 |
# File 'lib/rom/yesql/dataset.rb', line 13 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.
10 11 12 |
# File 'lib/rom/yesql/dataset.rb', line 10 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
22 23 24 |
# File 'lib/rom/yesql/dataset.rb', line 22 def read(query) connection.fetch(query) end |