Class: Paypal::Exception::APIError::Response::Detail

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal/exception/api_error.rb

Constant Summary collapse

@@attribute_mapping =
{
  :ERRORCODE => :error_code,
  :SEVERITYCODE => :severity_code,
  :LONGMESSAGE => :long_message,
  :SHORTMESSAGE => :short_message
}

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Detail

Returns a new instance of Detail.



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/paypal/exception/api_error.rb', line 36

def initialize(attributes = {})
  @raw = attributes
  attrs = attributes.dup
  @@attribute_mapping.each do |key, value|
    self.send "#{value}=", attrs.delete(key)
  end

  # warn ignored params
  attrs.each do |key, value|
    Paypal.log "Ignored Parameter (#{self.class}): #{key}=#{value}", :warn
  end
end