Module: PayPal::SDK::REST::RequestDataType
- Extended by:
- SetAPI
- Included in:
- DataTypes::Agreement, DataTypes::AlternatePayment, DataTypes::Authorization, DataTypes::BankAccount, DataTypes::Billing, DataTypes::BillingAgreementToken, DataTypes::Capture, DataTypes::CountryCode, DataTypes::CreditCard, DataTypes::CreditFinancingOffered, DataTypes::ExternalFunding, DataTypes::Invoice, DataTypes::Order, DataTypes::Payment, DataTypes::PaymentInstruction, DataTypes::Payout, DataTypes::PayoutItem, DataTypes::Plan, DataTypes::PotentialPayerInfo, DataTypes::PrivateLabelCard, DataTypes::ProcessorResponse, DataTypes::Refund, DataTypes::Sale, DataTypes::Template, DataTypes::Templates, DataTypes::WebProfile, DataTypes::Webhook, DataTypes::WebhookEvent, DataTypes::WebhooksEventType
- Defined in:
- lib/paypal-sdk/rest/request_data_type.rb
Class Method Summary collapse
-
.api ⇒ Object
Global API object === Example RequestDataType.api.
-
.included(klass) ⇒ Object
Configure depended module, when RequestDataType is include.
Instance Method Summary collapse
-
#api ⇒ Object
Get a local API object or Class level API object.
-
#error=(hash) ⇒ Object
Convert Hash object to ErrorHash object.
Methods included from SetAPI
client_id=, client_secret=, set_config, token=
Class Method Details
.api ⇒ Object
24 25 26 |
# File 'lib/paypal-sdk/rest/request_data_type.rb', line 24 def api @api ||= API.new end |
.included(klass) ⇒ Object
Configure depended module, when RequestDataType is include.
Example
class Payment < DataTypes
include RequestDataType
end
Payment.set_config(..)
payment.set_config(..)
Payment.api
payment.api
42 43 44 45 46 47 48 |
# File 'lib/paypal-sdk/rest/request_data_type.rb', line 42 def included(klass) klass.class_eval do extend GetAPI extend SetAPI include SetAPI end end |
Instance Method Details
#api ⇒ Object
Get a local API object or Class level API object
6 7 8 |
# File 'lib/paypal-sdk/rest/request_data_type.rb', line 6 def api @api || self.class.api end |