class RForce::SoapResponseExpat

Public Class Methods

new(content) click to toggle source
# File lib/rforce/soap_response_expat.rb, line 9
def initialize(content)
  @content = content
end

Public Instance Methods

parse() click to toggle source
# File lib/rforce/soap_response_expat.rb, line 13
def parse
  @current_value = nil
  @stack = []
  @parsed = MethodHash.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