Skip to content

Commit

Permalink
add ability to pass excon-specific options when initializing the adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
archfear committed May 29, 2012
1 parent f9eead9 commit 6d63ec5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/faraday/adapter/excon.rb
Expand Up @@ -3,6 +3,11 @@ class Adapter
class Excon < Faraday::Adapter
dependency 'excon'

def initialize(app, connection_options = {})
@connection_options = connection_options
super(app)
end

def call(env)
super

Expand All @@ -25,7 +30,7 @@ def call(env)
end
end

conn = ::Excon.new(env[:url].to_s, opts)
conn = ::Excon.new(env[:url].to_s, opts.merge(@connection_options))

resp = conn.request \
:method => env[:method].to_s.upcase,
Expand Down

0 comments on commit 6d63ec5

Please sign in to comment.