module Bart::Connection
Public Instance Methods
adapter()
click to toggle source
Return the class of the adapter to use for the connection
# File lib/bart_api/connection.rb, line 11 def adapter @@adapters[Bart.configuration.adapter] end
connection()
click to toggle source
Return the connection adapter instance
# File lib/bart_api/connection.rb, line 6 def connection @connection ||= adapter.new(Bart.configuration) end
register_adapter(name, klass)
click to toggle source
Register a new class that can be used as a connection adapter
# File lib/bart_api/connection.rb, line 16 def register_adapter name, klass (@@adapters ||= {})[name] = klass end