Class: HTTPI::Adapter::Excon
Overview
HTTPI::Adapter::Excon
Adapter for the Excon client. github.com/geemus/excon
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(request) ⇒ Excon
constructor
A new instance of Excon.
-
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
Methods inherited from Base
Constructor Details
#initialize(request) ⇒ Excon
Returns a new instance of Excon.
15 16 17 18 |
# File 'lib/httpi/adapter/excon.rb', line 15 def initialize(request) @request = request @client = ::Excon::Connection.new client_opts end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
20 21 22 |
# File 'lib/httpi/adapter/excon.rb', line 20 def client @client end |
Instance Method Details
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/httpi/adapter/excon.rb', line 24 def request(method) respond_with @client.send(method) rescue ::Excon::Errors::SocketError => e case e. when /verify certificate/ raise SSLError else $!.extend ConnectionError end raise end |