Class: CzechPostB2bClient::Services::ApiCaller

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

Direct Known Subclasses

XsdsDownloader

Defined Under Namespace

Classes: ApiCallerResult

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.



23
24
25
26
27
# File 'lib/czech_post_b2b_client/services/api_caller.rb', line 23

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

Instance Method Details

#stepsObject



29
30
31
# File 'lib/czech_post_b2b_client/services/api_caller.rb', line 29

def steps
  %i[call_api handle_response]
end