static public Method

SOAPElement.from_obj(obj, namespace = nil)

There's no documentation for this item.

Source Code

# File soap/baseData.rb, line 615
def self.from_obj(obj, namespace = nil)
  o = SOAPElement.new(nil)
  case obj
  when nil
    o.text = nil
  when Hash
    obj.each do |elename, value|
      if value.is_a?(Array)
        value.each do |subvalue|
          child = from_obj(subvalue, namespace)
          child.elename = to_elename(elename, namespace)
          o.add(child)
        end
      else
        child = from_obj(value, namespace)
        child.elename = to_elename(elename, namespace)
        o.add(child)
      end
    end
  else
    o.text = obj.to_s
  end
  o
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.