Class: OnlinePayments::SDK::ApiResource
- Inherits:
-
Object
- Object
- OnlinePayments::SDK::ApiResource
- Defined in:
- lib/onlinepayments/sdk/api_resource.rb
Overview
Base class of all Online Payments platform API resources. Provides shared functionality to facilitate communication with the Online Payments platform.
Direct Known Subclasses
Client, Merchant::Captures::CapturesClient, Merchant::Complete::CompleteClient, Merchant::HostedCheckout::HostedCheckoutClient, Merchant::HostedTokenization::HostedTokenizationClient, Merchant::Mandates::MandatesClient, Merchant::MerchantClient, Merchant::PaymentLinks::PaymentLinksClient, Merchant::Payments::PaymentsClient, Merchant::Payouts::PayoutsClient, Merchant::PrivacyPolicy::PrivacyPolicyClient, Merchant::ProductGroups::ProductGroupsClient, Merchant::Products::ProductsClient, Merchant::Refunds::RefundsClient, Merchant::Services::ServicesClient, Merchant::Sessions::SessionsClient, Merchant::Tokens::TokensClient, Merchant::Webhooks::WebhooksClient
Instance Attribute Summary collapse
-
#client_meta_info ⇒ String
readonly
JSON string containing client info specific to the current client.
-
#communicator ⇒ OnlinePayments::SDK::Communicator
readonly
Communicator instance that provides communication with the Online Payments platform.
Instance Method Summary collapse
-
#initialize(parent: nil, communicator: nil, path_context: nil, client_meta_info: nil) ⇒ ApiResource
constructor
Creates a new ApiResource.
Constructor Details
#initialize(parent: nil, communicator: nil, path_context: nil, client_meta_info: nil) ⇒ ApiResource
Creates a new ApiResource.
19 20 21 22 23 24 25 |
# File 'lib/onlinepayments/sdk/api_resource.rb', line 19 def initialize(parent: nil, communicator: nil, path_context: nil, client_meta_info: nil) raise ArgumentError.new('parent and/or communicator is required') if parent.nil? and communicator.nil? @parent = parent @communicator = communicator.nil? ? parent.communicator : communicator @path_context = path_context @client_meta_info = || parent.nil? ? : parent. end |
Instance Attribute Details
#client_meta_info ⇒ String (readonly)
JSON string containing client info specific to the current client.
10 11 12 |
# File 'lib/onlinepayments/sdk/api_resource.rb', line 10 def @client_meta_info end |
#communicator ⇒ OnlinePayments::SDK::Communicator (readonly)
Communicator instance that provides communication with the Online Payments platform.
10 11 12 |
# File 'lib/onlinepayments/sdk/api_resource.rb', line 10 def communicator @communicator end |