Sha256: 22098cbb716f0a52a7bf4ee04a9b7d97f51642e7693bf505b799044a0dff28f1
Contents?: true
Size: 583 Bytes
Versions: 12
Compression:
Stored size: 583 Bytes
Contents
module Vanity module Adapters class << self # Creates new connection to underlying datastore and returns suitable # adapter (adapter object extends AbstractAdapter and wraps the # connection). # # @since 1.4.0 def establish_connection(spec) begin require "vanity/adapters/#{spec[:adapter]}_adapter" rescue LoadError raise "Could not find #{spec[:adapter]} in your load path" end adapter_method = "#{spec[:adapter]}_connection" send(adapter_method, spec) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems