Sha256: 0faa5a31138c2f778cec9872894a4260d0f2af9cfc8e4deac51f38701d745c35
Contents?: true
Size: 729 Bytes
Versions: 2
Compression:
Stored size: 729 Bytes
Contents
require 'sequel' module Legion module Data class Connection attr_accessor :database def initialize(options = {}) options.merge!(default_options) { |_key, v1, _v2| v1 } return unless options[:auto_connect] jruby(options) if RUBY_ENGINE == 'jruby' mri(options) unless RUBY_ENGINE == 'jruby' end def default_options { auto_connect: true } end def jruby(_options = {}) require 'legion/data/connections/jdbc' @database = Legion::Data::Connections::JDBC.new end def mri(_options = {}) require 'legion/data/connections/mysql2' @database = Legion::Data::Connections::MySQL2.new end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
legion-data-0.1.1 | lib/legion/data/connection.rb |
legion-data-0.1.0 | lib/legion/data/connection.rb |