class PayPal::SDK::REST::ErrorHash

Public Class Methods

convert(hash) click to toggle source
# File lib/paypal-sdk/rest/error_hash.rb, line 5
def self.convert(hash)
  error_hash = new
  hash.each{|key, value|
    error_hash[key] = value
  }
  error_hash
end

Public Instance Methods

[](name) click to toggle source
Calls superclass method
# File lib/paypal-sdk/rest/error_hash.rb, line 25
def [](name)
  super(name.to_s) || super(name.to_sym)
end
[]=(key, value) click to toggle source
Calls superclass method
# File lib/paypal-sdk/rest/error_hash.rb, line 13
def []=(key, value)
  value =
    if value.is_a? Hash
      ErrorHash.convert(value)
    elsif value.is_a? Array and value[0].is_a? Hash
      value.map{|array_value| ErrorHash.convert(array_value) }
    else
      value
    end
  super(key, value)
end
method_missing(name, *args) click to toggle source
Calls superclass method
# File lib/paypal-sdk/rest/error_hash.rb, line 29
def method_missing(name, *args)
  if keys.include?(name) or keys.include?(name.to_s)
    self[name]
  else
    super
  end
end