Sha256: 2e3ff69f4d6b8d36df5142d52eb1a186fe5457a89ff59d9fba3e53a445a90f76

Contents?: true

Size: 799 Bytes

Versions: 12

Compression:

Stored size: 799 Bytes

Contents

require 'rexml/document'
require 'rexml/xpath'
require 'rforce/soap_pullable'


module RForce
  # Turns an XML response from the server into a Ruby
  # object whose methods correspond to nested XML elements.
  class SoapResponseRexml
    include SoapPullable
    include MethodKeys

    %w(attlistdecl cdata comment doctype doctype_end elementdecl
       entity entitydecl instruction notationdecl xmldecl).each do |unused|
      define_method(unused) {|*args|}
    end

    def initialize(content)
      @content = content
    end

    # Parses an XML string into structured data.
    def parse
      @current_value = nil
      @stack = []
      @parsed = MethodHash.new
      @done = false
      @namespaces = []

      REXML::Document.parse_stream @content, self

      @parsed
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rforce-0.15 lib/rforce/soap_response_rexml.rb
rforce-0.14 lib/rforce/soap_response_rexml.rb
rforce-0.13 lib/rforce/soap_response_rexml.rb
rforce-0.12 lib/rforce/soap_response_rexml.rb
rforce-0.11 lib/rforce/soap_response_rexml.rb
rforce-0.10 lib/rforce/soap_response_rexml.rb
rforce-0.9 lib/rforce/soap_response_rexml.rb
rforce-0.8.1 lib/rforce/soap_response_rexml.rb
rforce-0.8 lib/rforce/soap_response_rexml.rb
rforce-0.7 lib/rforce/soap_response_rexml.rb
rforce-0.6 lib/rforce/soap_response_rexml.rb
rforce-0.5.1 lib/rforce/soap_response_rexml.rb