Class: RForce::SoapResponseRexml

Inherits:
Object
  • Object
show all
Includes:
MethodKeys, 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 MethodKeys

#method_missing

Methods included from SoapPullable

#local, #tag_end, #tag_start, #text

Constructor Details

#initialize(content) ⇒ SoapResponseRexml

Returns a new instance of SoapResponseRexml.



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

def initialize(content)
  @content = content
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RForce::MethodKeys

Instance Method Details

#parseObject

Parses an XML string into structured data.



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

def parse
  @current_value = nil
  @stack = []
  @parsed = {}
  @done = false
  @namespaces = []

  REXML::Document.parse_stream @content, self
  
  @parsed
end