Sha256: b9f9e43085b93cc7c8bd962dc300a45dcf45c49aeb8eff2f25d50485dead8c28

Contents?: true

Size: 415 Bytes

Versions: 4

Compression:

Stored size: 415 Bytes

Contents

require 'rexml/document'
require 'xmlsimple'

class GaroonCat::Response

  def initialize(source)
    @source = source
    @doc = REXML::Document.new(source)
    if @doc.elements['//returns']
      @params = XmlSimple.xml_in(@doc.elements['//returns'].to_s)
    else
      raise @doc.elements['/soap:Envelope/soap:Body/soap:Fault/soap:Detail/cause'].text.strip
    end
  end

  def to_params
    @params
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
garoon-cat-0.3.0 lib/garoon-cat/response.rb
garoon-cat-0.2.1 lib/garoon-cat/response.rb
garoon-cat-0.2.0 lib/garoon-cat/response.rb
garoon-cat-0.1.0 lib/garoon-cat/response.rb