class Airbrake::Response

Public Class Methods

new(xml_body) click to toggle source
# File lib/airbrake/response.rb, line 19
def initialize(xml_body)
  @xml_body = xml_body
  @url      = parse_tag("url")
  @id       = parse_tag("id")
end
pretty_format(xml_body) click to toggle source
# File lib/airbrake/response.rb, line 3
def self.pretty_format(xml_body)
  new(xml_body)
rescue
  xml_body
end

Public Instance Methods

to_s() click to toggle source
# File lib/airbrake/response.rb, line 9
def to_s
  output = "\n"
  output = "UUID: #{@id}"
  output << "\n"
  output << "URL:  #{@url}"
  output
end

Private Instance Methods

parse_tag(name) click to toggle source
# File lib/airbrake/response.rb, line 25
def parse_tag(name)
  @xml_body.match(%r{<#{name}[^>]*>(.*?)</#{name}>})[1]
end