Class: CzechPostB2bClient::Services::ApiCaller

Inherits:
SteppedService::Base show all
Defined in:
lib/czech_post_b2b_client/services/api_caller.rb

Constant Summary collapse

KNOWN_CONNECTION_ERRORS =
[
  Timeout::Error,
  Errno::EINVAL,
  Errno::ECONNRESET,
  EOFError,
  SocketError,
  Net::ReadTimeout,
  Net::HTTPBadResponse,
  Net::HTTPHeaderSyntaxError,
  Net::ProtocolError
].freeze

Instance Attribute Summary

Attributes inherited from SteppedService::Base

#result

Instance Method Summary collapse

Methods inherited from SteppedService::Base

call, #call, #errors, #failure?, #finished?, #success?

Constructor Details

#initialize(endpoint_path:, xml:) ⇒ ApiCaller

Returns a new instance of ApiCaller



21
22
23
24
# File 'lib/czech_post_b2b_client/services/api_caller.rb', line 21

def initialize(endpoint_path:, xml:)
  @endpoint_path = endpoint_path
  @request_xml = xml
end

Instance Method Details

#stepsObject



26
27
28
# File 'lib/czech_post_b2b_client/services/api_caller.rb', line 26

def steps
  %i[call_api handle_response]
end