Sha256: 3ce7839a55052b8c9ca9a85fecfb1c9c9a88ceec3c34aa1f6d8bf160ca6429bc
Contents?: true
Size: 584 Bytes
Versions: 5
Compression:
Stored size: 584 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
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
vanity-4.0.4 | lib/vanity/adapters.rb |
vanity-4.0.3 | lib/vanity/adapters.rb |
vanity-4.0.2 | lib/vanity/adapters.rb |
vanity-4.0.1 | lib/vanity/adapters.rb |
vanity-4.0.0 | lib/vanity/adapters.rb |