Exception: Reactor::Cm::XmlSingleRequestError

Inherits:
XmlRequestError show all
Defined in:
lib/reactor/cm/xml_single_request_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ XmlSingleRequestError

Returns a new instance of XmlSingleRequestError.



6
7
8
9
# File 'lib/reactor/cm/xml_single_request_error.rb', line 6

def initialize(response)
  @response = response
  super(phrase)
end

Instance Method Details

#phraseObject



11
12
13
14
15
16
# File 'lib/reactor/cm/xml_single_request_error.rb', line 11

def phrase
  result = @response.xpath("//phrase/text()")
  result = [result] unless result.is_a?(Array)

  result.map(&:to_s).join("\n")
end