3 4 5 6 7 8
# File 'lib/smslist/response.rb', line 3 def parse_xml(response) Nokogiri::XML(response.body).tap do |xml| error = xml.xpath('response/error').text raise Smslist::Error.new(error) unless error.empty? end end