Sha256: 9b8751d164fdbcd10782c2203013dd64680b83fe9d4de887a3cad6f84a1b2163

Contents?: true

Size: 667 Bytes

Versions: 4

Compression:

Stored size: 667 Bytes

Contents

require 'xml/parser'
require 'rforce/soap_pullable'

module RForce
  class SoapResponseExpat
    include SoapPullable

    def initialize(content)
      @content = content
    end

    def parse
      @current_value = nil
      @stack = []
      @parsed = OpenHash.new({})
      @done = false
      @namespaces = []

      XML::Parser.new.parse(@content) do |type, name, data|
        case type
        when XML::Parser::START_ELEM then
          tag_start name, data
        when XML::Parser::CDATA then
          text data
        when XML::Parser::END_ELEM then
          tag_end name
        end

        break if @done
      end

      @parsed
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
rforcedotcom-20.0.0 lib/rforce/soap_response_expat.rb
rforce-raygao-1.0.0 lib/rforce/soap_response_expat.rb
rforce-0.4.1 lib/rforce/soap_response_expat.rb
rforce-0.4 lib/rforce/soap_response_expat.rb