Class: RForce::SoapResponseRexml

Inherits:
Object
  • Object
show all
Includes:
SoapPullable
Defined in:
lib/rforce/soap_response_rexml.rb

Overview

Turns an XML response from the server into a Ruby object whose methods correspond to nested XML elements.

Constant Summary

Constants included from SoapPullable

RForce::SoapPullable::SOAP_ENVELOPE

Instance Method Summary collapse

Methods included from SoapPullable

#local, #tag_end, #tag_start, #text

Constructor Details

#initialize(content) ⇒ SoapResponseRexml

Returns a new instance of SoapResponseRexml.



17
18
19
# File 'lib/rforce/soap_response_rexml.rb', line 17

def initialize(content)
  @content = content
end

Instance Method Details

#parseObject

Parses an XML string into structured data.



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rforce/soap_response_rexml.rb', line 22

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

  REXML::Document.parse_stream @content, self

  @parsed
end