Class: Worldline::Acquiring::SDK::V1::Ping::PingClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Worldline::Acquiring::SDK::V1::Ping::PingClient
- Defined in:
- lib/worldline/acquiring/sdk/v1/ping/ping_client.rb
Overview
Ping client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
Instance Method Summary collapse
-
#initialize(parent, path_context) ⇒ PingClient
constructor
A new instance of PingClient.
-
#ping(context = nil) ⇒ Object
Resource /services/v1/ping - Check API connection.
Constructor Details
#initialize(parent, path_context) ⇒ PingClient
Returns a new instance of PingClient.
19 20 21 |
# File 'lib/worldline/acquiring/sdk/v1/ping/ping_client.rb', line 19 def initialize(parent, path_context) super(parent: parent, path_context: path_context) end |
Instance Method Details
#ping(context = nil) ⇒ Object
Resource /services/v1/ping - Check API connection
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/worldline/acquiring/sdk/v1/ping/ping_client.rb', line 34 def ping(context = nil) uri = instantiate_uri('/services/v1/ping', nil) @communicator.get( uri, nil, nil, nil, context) rescue Worldline::Acquiring::SDK::Communication::ResponseException => e error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context) end |