Exception: Handsoap::Fault
- Inherits:
-
Exception
- Object
- Exception
- Handsoap::Fault
- Defined in:
- lib/handsoap/service.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code, reason, details) ⇒ Fault
constructor
A new instance of Fault.
- #to_s ⇒ Object
Constructor Details
#initialize(code, reason, details) ⇒ Fault
Returns a new instance of Fault.
76 77 78 79 80 |
# File 'lib/handsoap/service.rb', line 76 def initialize(code, reason, details) @code = code @reason = reason @details = details end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
75 76 77 |
# File 'lib/handsoap/service.rb', line 75 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
75 76 77 |
# File 'lib/handsoap/service.rb', line 75 def details @details end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
75 76 77 |
# File 'lib/handsoap/service.rb', line 75 def reason @reason end |
Class Method Details
.from_xml(node, options = { :namespace => nil }) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/handsoap/service.rb', line 84 def self.from_xml(node, = { :namespace => nil }) if not [:namespace] raise "Missing option :namespace" end ns = { 'env' => [:namespace] } fault_code = node.xpath('./env:Code/env:Value/text()', ns).to_s if fault_code == "" fault_code = node.xpath('./faultcode/text()', ns).to_s end reason = node.xpath('./env:Reason/env:Text[1]/text()', ns).to_s if reason == "" reason = node.xpath('./faultstring/text()', ns).to_s end details = node.xpath('./detail/*', ns) self.new(fault_code, reason, details) end |
Instance Method Details
#to_s ⇒ Object
81 82 83 |
# File 'lib/handsoap/service.rb', line 81 def to_s "Handsoap::Fault { :code => '#{@code}', :reason => '#{@reason}' }" end |