1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* imported and refactored original test cases

* added methods XMLRPC::XMLParser.each_installed_parser and
  XMLRPC::XMLWriter.each_installed_writer to simply original test cases

* use Object#allocate instead of defining an empty #initialize

* module XMLRPC::Marshallable is now only used for tagging


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mneumann 2004-11-15 23:26:20 +00:00
parent 67d54f209d
commit 396b1f27ca
18 changed files with 475 additions and 31 deletions

View file

@ -86,6 +86,18 @@ module XMLRPC
end # class XMLParser
Classes = [Simple, XMLParser]
# yields an instance of each installed XML writer
def self.each_installed_writer
XMLRPC::XMLWriter::Classes.each do |klass|
begin
yield klass.new
rescue LoadError
end
end
end
end # module XMLWriter
class Create
@ -248,7 +260,10 @@ module XMLRPC
if Config::ENABLE_MARSHALLING and param.class.included_modules.include? XMLRPC::Marshallable
# convert Ruby object into Hash
ret = {"___class___" => param.class.name}
param.__get_instance_variables.each {|name, val|
param.instance_variables.each {|v|
name = v[1..-1]
val = param.instance_variable_get(v)
if val.nil?
ret[name] = val if Config::ENABLE_NIL_CREATE
else