Module: Guidestar::Connection
- Included in:
- Client
- Defined in:
- lib/guidestar/connection.rb
Instance Method Summary collapse
-
#connection ⇒ Faraday::Connection
Raw HTTPS connection with Faraday::Connection.
Instance Method Details
#connection ⇒ Faraday::Connection
Raw HTTPS connection with Faraday::Connection
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/guidestar/connection.rb', line 6 def connection return @connection if @connection opts = { :url => api_url, :params => {}, :headers => default_headers } opts[:ssl] = @ssl_options if @ssl_options.is_a?(Hash) @connection = Faraday.new(opts) do |conn| conn.response :mashify conn.response :xml, :content_type => /\bxml$/ conn.response :raise_guidestar_error conn.adapter Faraday.default_adapter end @connection.proxy(self.proxy) if self.proxy @connection end |