This program is copyrighted free software by NAKAMURA, Hiroshi. You can redistribute it and/or modify it under the same terms of Ruby’s license; either the dual license version in 2003, or any later version.
# File wsdl/soap/classDefCreator.rb, line 266
def dump_arraydef(complextype)
qname = complextype.name
c = XSD::CodeGen::ClassDef.new(create_class_name(qname), '::Array')
c.comment = "#{qname}"
child_type = complextype.child_type
c.def_classvar('schema_type', ndq(child_type.name))
c.def_classvar('schema_ns', ndq(child_type.namespace))
child_element = complextype.find_aryelement
schema_element = []
if child_type == XSD::AnyTypeName
type = nil
elsif child_element and (klass = element_basetype(child_element))
type = klass.name
elsif child_type
type = create_class_name(child_type)
else
type = nil
end
if child_element
if child_element.map_as_array?
type << '[]' if type
end
child_element_name = child_element.name
else
child_element_name = DEFAULT_ITEM_NAME
end
schema_element << [child_element_name.name, child_element_name, type]
c.def_classvar('schema_element',
'[' +
schema_element.collect { |varname, name, type|
'[' +
(
if name
varname.dump + ', [' + ndq(type) + ', ' + dqname(name) + ']'
else
varname.dump + ', ' + ndq(type)
end
) +
']'
}.join(', ') +
']'
)
c.dump
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.