Sha256: b2de8132d144977555d3be74dd8a19c23ab809ce4f404dd09599f3cc923437f7

Contents?: true

Size: 534 Bytes

Versions: 8

Compression:

Stored size: 534 Bytes

Contents

require 'xmlsimple'
module SmsNotify
  # Handles parsing a CDYNE SmsNotify! XML response
  # into a Ruby-like hash.
  class Response
    class << self
	    # Converts XML into a Ruby-like hash
	    def parse(response)
	      if response.is_a?(SOAP::Mapping::Object)
          soap_response = SoapResponse.new(response)
          soap_response.to_hash
	      else
	        parser = XmlSimple.new({'ForceArray' => false, 'KeepRoot' => true, 'SuppressEmpty' => nil})
	        parser.xml_in(response)
	      end
	    end
	  end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cdyne-sms-notify-1.0.6 lib/sms_notify/response.rb
cdyne-sms-notify-1.0.4 lib/sms_notify/response.rb
cdyne-sms-notify-1.0.3 lib/sms_notify/response.rb
cdyne-sms-notify-1.0.2 lib/sms_notify/response.rb
cdyne-sms-notify-1.0.1 lib/sms_notify/response.rb
cdyne-sms-notify-1.0.0 lib/sms_notify/response.rb
cdyne-sms-notify-0.10.1 lib/sms_notify/response.rb
cdyne-sms-notify-0.10.0 lib/sms_notify/response.rb