Sha256: 8fe0eb75f3861a331d35bdab51a3480848716c943087a736361fd96017e9881c
Contents?: true
Size: 1.19 KB
Versions: 2
Compression:
Stored size: 1.19 KB
Contents
# encoding: utf-8 require 'axiom' require 'axiom-sql-generator' require 'data_objects' module Axiom module Adapter # An adapter wrapping a DataObjects connection class DataObjects include Adamantium # Initialize a DataObjects adapter # # @param [String] uri # # @return [undefined] # # @api private def initialize(uri) @uri = uri end # Read the results from the SQL representation of the relation # # @example # adapter.read(relation) { |row| ... } # # @param [Relation] relation # # @yield [row] # # @yieldparam [Array] row # each row in the results # # @return [self] # # @api public 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 end # class DataObjects end # module Adapter end # module Axiom require 'axiom/adapter/data_objects/version' require 'axiom/adapter/data_objects/statement'
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
axiom-do-adapter-0.2.0 | lib/axiom/adapter/data_objects.rb |
axiom-do-adapter-0.1.0 | lib/axiom/adapter/data_objects.rb |