Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1635

Show
Ignore:
Timestamp:
09/25/05 22:23:52 (3 years ago)
Author:
nahi
Message:

let SOAPElement.from_obj handle an Array of key-value pair.

SOAPElement.from_obj({"a" => "b", "c" => "d"})
SOAPElement.from_obj([["a", "b"], ["c", "d"]]) # keep its order

closes #156.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/baseData.rb

    r1604 r1635  
    540540 
    541541  def inspect 
    542     sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename) 
     542    sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename) + 
     543      (@text ? " #{@text.inspect}" : '') + 
     544      @data.collect { |ele| "\n#{ele.inspect}" }.join.gsub(/^/, '  ') 
    543545  end 
    544546 
     
    618620    when nil 
    619621      o.text = nil 
    620     when Hash 
     622    when Hash, Array 
    621623      obj.each do |elename, value| 
    622624        if value.is_a?(Array)