Sha256: 206909d4db722c3b3752f2b7ce47879648903fa84a27274ce8de7306a976d95b

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module Airbrake
  class Response
    def self.pretty_format(xml_body)
      new(xml_body)
    rescue
      xml_body
    end

    def to_s
      output = "\n"
      output = "UUID: #{id}"
      output << "\n"
      output << "URL:  #{url}"
      output
    end

    private

    attr_accessor :xml_body, :url, :id

    def initialize(xml_body)
      self.xml_body = xml_body
      self.url      = parse_tag("url")
      self.id       = parse_tag("id")
    end

    def parse_tag(name)
      xml_body.match(%r{<#{name}[^>]*>(.*?)</#{name}>})[1]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
airbrake-3.1.12 lib/airbrake/response.rb
airbrake-3.1.11 lib/airbrake/response.rb