This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
struct(hash)
public
Converts the given hash to a marshalled object.
Returns the given hash if an exception occurs.
# File lib/xmlrpc/parser.rb, line 142
def self.struct(hash)
# convert to marshalled object
klass = hash["___class___"]
if klass.nil? or Config::ENABLE_MARSHALLING == false
hash
else
begin
mod = Module
klass.split("::").each {|const| mod = mod.const_get(const.strip)}
obj = mod.allocate
hash.delete "___class___"
hash.each {|key, value|
obj.instance_variable_set("@#{ key }", value) if key =~ /^([a-zA-Z_]\w*)$/
}
obj
rescue
hash
end
end
end