Class: Veritas::Adapter::DataObjects
- Inherits:
-
Object
- Object
- Veritas::Adapter::DataObjects
- Includes:
- Immutable
- Defined in:
- lib/veritas/adapter/data_objects.rb,
lib/veritas/adapter/data_objects/version.rb,
lib/veritas/adapter/data_objects/statement.rb
Overview
An adapter wrapping a DataObjects connection
Defined Under Namespace
Classes: Statement
Constant Summary collapse
- VERSION =
'0.0.7'
Instance Method Summary collapse
-
#initialize(uri) ⇒ undefined
constructor
private
Initialize a DataObjects adapter.
-
#read(relation) {|row| ... } ⇒ self
Read the results from the SQL representation of the relation.
Constructor Details
#initialize(uri) ⇒ undefined
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.
Initialize a DataObjects adapter
21 22 23 |
# File 'lib/veritas/adapter/data_objects.rb', line 21 def initialize(uri) @uri = uri end |
Instance Method Details
#read(relation) {|row| ... } ⇒ self
Read the results from the SQL representation of the relation
40 41 42 43 44 45 46 47 |
# File 'lib/veritas/adapter/data_objects.rb', line 40 def read(relation) return to_enum(__method__, relation) unless block_given? connection = ::DataObjects::Connection.new(@uri) Statement.new(connection, relation).each { |row| yield row } self ensure connection.close if connection end |