requires @defined_const, @simpletypes, @name_creator
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 87 def assign_const(value, prefix = '') return if value.nil? or @defined_const.key?(value) name = value.scan(/[^:\/]+\/?\z/)[0] || 'C' tag = prefix + safeconstname(name) if @defined_const.value?(tag) idx = 0 while true tag = prefix + safeconstname(name + "_#{idx}") break unless @defined_const.value?(tag) idx += 1 raise RuntimeError.new("too much similar names") if idx > 100 end end @defined_const[value] = tag end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 32 def basetype_mapped_class(name) ::SOAP::TypeMap[name] end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 103 def create_type_name(modulepath, element) if element.type == XSD::AnyTypeName # nil means anyType. nil elsif simpletype = @simpletypes[element.type] if simpletype.restriction and simpletype.restriction.enumeration? mapped_class_name(element.type, modulepath) else nil end elsif klass = element_basetype(element) klass.name elsif element.type mapped_class_name(element.type, modulepath) elsif element.ref mapped_class_name(element.ref, modulepath) elsif element.anonymous_type? # inner class mapped_class_name(element.name, modulepath) else nil end end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 63 def dq(ele) ele.dump end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 79 def dqname(qname) if @defined_const.key?(qname.namespace) qname.dump(@defined_const[qname.namespace]) else qname.dump end end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 36 def dump_method_signature(operation, element_definitions) name = operation.name input = operation.input output = operation.output fault = operation.fault signature = "#{ name }#{ dump_inputparam(input) }" str = # SYNOPSIS# #{name}#{dump_inputparam(input)}## ARGS#{dump_inout_type(input, element_definitions).chomp}## RETURNS#{dump_inout_type(output, element_definitions).chomp}# unless fault.empty? str <<# RAISES#{dump_fault_type(fault, element_definitions)}# end str end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 27 def mapped_class_basename(qname, modulepath) classname = @name_creator.assign_name(qname, modulepath) classname.sub(/\A.*:/, '') end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 23 def mapped_class_name(qname, modulepath) @name_creator.assign_name(qname, modulepath) end
# File lib/wsdl/soap/classDefCreatorSupport.rb, line 67 def ndq(ele) ele.nil? ? 'nil' : dq(ele) end
Generated with the Darkfish Rdoc Generator 2.