Method: Ratis::Errors::SoapError#initialize

Defined in:
lib/ratis/errors.rb

#initialize(savon_soap_fault = nil) ⇒ SoapError

Returns a new instance of SoapError.



10
11
12
13
14
15
16
# File 'lib/ratis/errors.rb', line 10

def initialize(savon_soap_fault = nil)
  return if savon_soap_fault.nil? or savon_soap_fault.blank?
  fault             = savon_soap_fault.to_hash[:fault]
  code              = fault[:faultcode].scan(/\d+/).first
  self.fault_code   = code.to_i if code
  self.fault_string = fault[:faultstring]
end