Class: WSDL::SOAP::ClassNameCreator
- Includes:
- XSD::CodeGen::GenSupport
- Defined in:
- lib/wsdl/soap/classNameCreator.rb
Instance Method Summary collapse
- #assign_name(qname, modulepath = nil) ⇒ Object
- #check_classname(name) ⇒ Object
-
#initialize ⇒ ClassNameCreator
constructor
A new instance of ClassNameCreator.
Methods included from XSD::CodeGen::GenSupport
capitalize, constant?, #format, keyword?, safeconstname, safeconstname?, safemethodname, safemethodname?, safevarname, safevarname?, uncapitalize
Constructor Details
#initialize ⇒ ClassNameCreator
Returns a new instance of ClassNameCreator.
20 21 22 |
# File 'lib/wsdl/soap/classNameCreator.rb', line 20 def initialize @classname = {} end |
Instance Method Details
#assign_name(qname, modulepath = nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/wsdl/soap/classNameCreator.rb', line 24 def assign_name(qname, modulepath = nil) key = [modulepath, qname] unless @classname.key?(key) if klass = ::SOAP::TypeMap[qname] name = ::SOAP::Mapping::DefaultRegistry.find_mapped_obj_class(klass).name else name = safeconstname(qname.name) if modulepath name = [modulepath, name].join('::') end while @classname.value?(name) name += '_' end check_classname(name) end @classname[key] = name.freeze end @classname[key] end |