Module: PayPal::SDK::Subscriptions::RequestDataType

Included in:
RequestAPIBase
Defined in:
lib/paypal-sdk/subscriptions/request_data_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.apiObject

Global API object

Example

RequestDataType.api


51
52
53
# File 'lib/paypal-sdk/subscriptions/request_data_type.rb', line 51

def api
  @api ||= API.new
end

.included(klass) ⇒ Object

Configure depended module, when RequestDataType is include.

Example

class Payment < DataTypes
  include RequestDataType
end
Payment.api
payment.api


62
63
64
65
66
# File 'lib/paypal-sdk/subscriptions/request_data_type.rb', line 62

def included(klass)
  klass.class_eval do
    extend GetAPI
  end
end

Instance Method Details

#apiObject

Get a local API object or Class level API object



33
34
35
# File 'lib/paypal-sdk/subscriptions/request_data_type.rb', line 33

def api
  @api || self.class.api
end

#error=(hash) ⇒ Object

Convert Hash object to ErrorHash object



38
39
40
41
42
43
44
45
# File 'lib/paypal-sdk/subscriptions/request_data_type.rb', line 38

def error=(hash)
  @error =
    if hash.is_a? Hash
      ErrorHash.convert(hash)
    else
      hash
    end
end