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.
21 22 23 |
# File 'lib/wsdl/soap/classNameCreator.rb', line 21 def initialize @classname = {} end |
Instance Method Details
#assign_name(qname, modulepath = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/wsdl/soap/classNameCreator.rb', line 25 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 #MODIFICATO #aggiunge degli _ al nome della classe per non fare lo stesso nome di classe # while @classname.value?(name) # name += '_' # end check_classname(name) end @classname[key] = name.freeze end @classname[key] end |