Class: SmoothOperator::OperatorCall::Typhoeus
- Defined in:
- lib/smooth_operator/operator_call/typhoeus.rb
Instance Attribute Summary
Attributes inherited from Base
#body, #connection, #endpoint_pass, #endpoint_user, #http_verb, #operator_class, #operator_options, #options, #params, #relative_path
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from SmoothOperator::OperatorCall::Base
Instance Method Details
#make_the_call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smooth_operator/operator_call/typhoeus.rb', line 9 def make_the_call begin set_basic_authentication response = connection.send(http_verb) do |request| .each { |key, value| request..send("#{key}=", value) } [:headers].each { |key, value| request.headers[key] = value } params.each { |key, value| request.params[key] = value } request.url relative_path request.body = body end RemoteCall::Base.new(response) rescue ::Faraday::Error::ConnectionFailed RemoteCall::Errors::ConnectionFailed.new(response) rescue ::Faraday::Error::TimeoutError RemoteCall::Errors::Timeout.new(response) end end |