Class: Savon::SOAPFault
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#nori ⇒ Object
readonly
Returns the value of attribute nori.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http, nori) ⇒ SOAPFault
constructor
A new instance of SOAPFault.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(http, nori) ⇒ SOAPFault
Returns a new instance of SOAPFault.
14 15 16 17 |
# File 'lib/savon/soap_fault.rb', line 14 def initialize(http, nori) @http = http @nori = nori end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
19 20 21 |
# File 'lib/savon/soap_fault.rb', line 19 def http @http end |
#nori ⇒ Object (readonly)
Returns the value of attribute nori.
19 20 21 |
# File 'lib/savon/soap_fault.rb', line 19 def nori @nori end |
Class Method Details
.present?(http) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/savon/soap_fault.rb', line 6 def self.present?(http) fault_node = http.body.include?("Fault>") soap1_fault = http.body.include?("faultcode>") && http.body.include?("faultstring>") soap2_fault = http.body.include?("Code>") && http.body.include?("Reason>") fault_node && (soap1_fault || soap2_fault) end |
Instance Method Details
#to_hash ⇒ Object
26 27 28 29 |
# File 'lib/savon/soap_fault.rb', line 26 def to_hash parsed = nori.parse(@http.body) nori.find(parsed, 'Envelope', 'Body') end |
#to_s ⇒ Object
21 22 23 24 |
# File 'lib/savon/soap_fault.rb', line 21 def to_s fault = nori.find(to_hash, 'Fault') (fault) end |