Sha256: 4d5d78ab898a9e6184fc53fca2d8678aa6299bc6844e124a1b8dc3ad757ab133

Contents?: true

Size: 669 Bytes

Versions: 5

Compression:

Stored size: 669 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
          tag_start name, data
        when XML::Parser::CDATA
          text data
        when XML::Parser::END_ELEM
          tag_end name
        end
          
        break if @done
      end

      @parsed
    end
  end
end

Version data entries

5 entries across 5 versions & 4 rubygems

Version Path
copious-activerecord-activesalesforce-adapter-2.3.1 lib/rforce/soap_response_expat.rb
johnreilly-activerecord-activesalesforce-adapter-2.3.5 lib/rforce/soap_response_expat.rb
sportgenic-activerecord-activesalesforce-adapter-2.3.3 lib/rforce/soap_response_expat.rb
sportgenic-activerecord-activesalesforce-adapter-2.3.4 lib/rforce/soap_response_expat.rb
althor880-activerecord-activesalesforce-adapter-2.3.5 lib/rforce/soap_response_expat.rb