Class: Afipws::Client
- Inherits:
-
Object
- Object
- Afipws::Client
- Defined in:
- lib/afipws/client.rb
Instance Method Summary collapse
-
#initialize(savon_options) ⇒ Client
constructor
A new instance of Client.
- #operations ⇒ Object
- #request(action, body = nil) ⇒ Object
Constructor Details
#initialize(savon_options) ⇒ Client
Returns a new instance of Client.
19 20 21 |
# File 'lib/afipws/client.rb', line 19 def initialize @savon = Savon.client .reverse_merge(soap_version: 2, ssl_version: :TLSv1_2) end |
Instance Method Details
#operations ⇒ Object
33 34 35 |
# File 'lib/afipws/client.rb', line 33 def operations @savon.operations end |
#request(action, body = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/afipws/client.rb', line 23 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 |