Method: Fog::Core::Connection#initialize
- Defined in:
- lib/fog/core/connection.rb
#initialize(url, persistent = false, params = {}) ⇒ Connection
Prepares the connection and sets defaults for any future requests.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/core/connection.rb', line 46 def initialize(url, persistent = false, params = {}) @path_prefix = params.delete(:path_prefix) if @path_prefix && params[:path] raise ArgumentError, "optional arg 'path' is invalid when 'path_prefix' is provided" end params[:debug_response] = true unless params.key?(:debug_response) params[:headers] ||= {} params.merge!(:persistent => params.fetch(:persistent, persistent)) params[:headers]["User-Agent"] ||= user_agent @excon = Excon.new(url, params) end |