module ActiveResource::Connections::CoreExt

Public Class Methods

connection(refresh = false) click to toggle source

@overload

# File lib/active_resource/connections/core_ext.rb, line 7
def self.connection(refresh = false)
  if defined?(@connection) || superclass == Object
    @connection = connection_class.new(site, format) if refresh || @connection.nil?
    @connection.proxy = proxy if proxy
    @connection.user = user if user
    @connection.password = password if password
    @connection.auth_type = auth_type if auth_type
    @connection.timeout = timeout if timeout
    @connection.ssl_options = ssl_options if ssl_options
    @connection
  else
    superclass.connection
  end
end