class PayPal::SDK::REST::DataTypes::Base

Attributes

error[RW]
header[W]
request_id[W]

Public Class Methods

load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 40
def self.load_members
end
raise_on_api_error(*methods) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 43
def self.raise_on_api_error(*methods)
  methods.each do |symbol|
    define_method("#{symbol}!") {|*arg|
      raise_error! unless send(symbol, *arg)
    }
  end
end

Public Instance Methods

header() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 15
def header
  @header ||= {}
end
http_header() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 23
def http_header
  { "PayPal-Request-Id" => request_id.to_s }.merge(header)
end
merge!(values) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 31
def merge!(values)
  @error = nil
  super
end
raise_error!() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 36
def raise_error!
  raise Core::Exceptions::UnsuccessfulApiCall, error if error
end
request_id() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 19
def request_id
  @request_id ||= SecureRandom.uuid
end
success?() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 27
def success?
  @error.nil?
end