Class: Ingenico::Connect::SDK::ApiResource
- Inherits:
-
Object
- Object
- Ingenico::Connect::SDK::ApiResource
- Defined in:
- lib/ingenico/connect/sdk/api_resource.rb
Overview
Base class of all Ingenico ePayments platform API resources. Provides shared functionality to facilitate communication with the Ingenico ePayments platform.
Direct Known Subclasses
Client, Merchant::Captures::CapturesClient, Merchant::Hostedcheckouts::HostedcheckoutsClient, Merchant::Mandates::MandatesClient, Merchant::MerchantClient, Merchant::Payments::PaymentsClient, Merchant::Payouts::PayoutsClient, Merchant::Productgroups::ProductgroupsClient, Merchant::Products::ProductsClient, Merchant::Refunds::RefundsClient, Merchant::Riskassessments::RiskassessmentsClient, Merchant::Services::ServicesClient, Merchant::Sessions::SessionsClient, Merchant::Tokens::TokensClient
Instance Attribute Summary collapse
-
#client_meta_info ⇒ Object
readonly
JSON string containing client info specific to the current client.
-
#communicator ⇒ Object
readonly
Communicator instance that provides communication with the Ingenico ePayments platform.
Instance Method Summary collapse
-
#initialize(arg, path_context, client_meta_info = FALSE) ⇒ ApiResource
constructor
Creates a new ApiResource.
Constructor Details
#initialize(arg, path_context, client_meta_info = FALSE) ⇒ ApiResource
Creates a new ApiResource.
- arg
-
Parent class or Communicator instance. If a parent class is given its communicator will be used for communication.
- path_context
-
Hash that contains substitutions for generic locations in the url path. This hash will be used to instantiate a concrete url used to access specific resources. For example in the url api-sandbox.globalcollect.com/{version}/{merchantId}/payments {version} and {merchantId} can be instantiated using the hash {‘version’ => ‘v1’, ‘merchantId’ => ‘1234’}. The final url in this case will be api-sandbox.globalcollect.com/v1/1234/payments.
- client_meta_info
-
JSON string containing the meta data for the client.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ingenico/connect/sdk/api_resource.rb', line 19 def initialize(arg, path_context, =FALSE) if == FALSE if arg.nil? raise ArgumentError.new('parent is required') end @parent = arg @communicator = arg.communicator @path_context = path_context @client_meta_info = arg. else if arg.nil? raise ArgumentError.new('communicator is required') end @parent = nil @communicator = arg @path_context = path_context @client_meta_info = end end |
Instance Attribute Details
#client_meta_info ⇒ Object (readonly)
JSON string containing client info specific to the current client.
43 44 45 |
# File 'lib/ingenico/connect/sdk/api_resource.rb', line 43 def @client_meta_info end |
#communicator ⇒ Object (readonly)
Communicator instance that provides communication with the Ingenico ePayments platform.
40 41 42 |
# File 'lib/ingenico/connect/sdk/api_resource.rb', line 40 def communicator @communicator end |