Class: Arca::Client
- Inherits:
-
Object
- Object
- Arca::Client
- Defined in:
- lib/arca/client.rb
Instance Method Summary collapse
-
#initialize(savon_options) ⇒ Client
constructor
A new instance of Client.
- #request(action, body = nil) ⇒ Object
Constructor Details
#initialize(savon_options) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/arca/client.rb', line 5 def initialize() savon_opts = .reverse_merge( soap_version: 2, ssl_version: :TLSv1_2, ssl_ciphers: "DEFAULT:!DH:!DHE", ssl_ca_cert_file: OpenSSL::X509::DEFAULT_CERT_FILE ) @savon = Savon.client savon_opts end |
Instance Method Details
#request(action, body = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/arca/client.rb', line 16 def request(action, body = nil) @savon.call action, message: body rescue Savon::SOAPFault, Savon::HTTPError => e raise ServerError, e rescue HTTPClient::ConnectTimeoutError => e raise NetworkError.new(e, retriable: true) rescue HTTPClient::TimeoutError => e raise NetworkError, e end |