Sha256: f633a28f77655e62f68c6b9d5dfe4cfb5d1093b5e41bf1148f0b07c4cd1b5788

Contents?: true

Size: 364 Bytes

Versions: 2

Compression:

Stored size: 364 Bytes

Contents

require 'mysql2'
module Mysql2xxxx
  class Client
    attr_reader :properties
    def initialize(properties)
      @properties = properties
    end
    def select_each(sql, &blk)
      mysql2.query(sql).each do |hsh|
        yield hsh
      end
    end
    private
    def mysql2
      @mysql2 ||= ::Mysql2::Client.new properties.database_config
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mysql2xxxx-0.0.2 lib/mysql2xxxx/client.rb
mysql2xxxx-0.0.1 lib/mysql2xxxx/client.rb