Module: WSDL::SOAP::ClassDefCreatorSupport

Instance Method Summary collapse

Methods included from XSD::CodeGen::GenSupport

capitalize, constant?, #format, keyword?, safeconstname, safeconstname?, safemethodname, safemethodname?, safevarname, safevarname?, uncapitalize

Instance Method Details

#basetype_mapped_class(name) ⇒ Object


35
36
37
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 35

def basetype_mapped_class(name)
  ::SOAP::TypeMap[name]
end

#create_class_name(qname, modulepath = nil) ⇒ Object


22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 22

def create_class_name(qname, modulepath = nil)
  if klass = basetype_mapped_class(qname)
    ::SOAP::Mapping::DefaultRegistry.find_mapped_obj_class(klass).name
  else
    name = safeconstname(qname.name)
    if modulepath
      [modulepath, name].join('::')
    else
      name
    end
  end
end

#dq(ele) ⇒ Object


66
67
68
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 66

def dq(ele)
  ele.dump
end

#dqname(qname) ⇒ Object


82
83
84
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 82

def dqname(qname)
  qname.dump
end

#dump_method_signature(operation, element_definitions) ⇒ Object


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 39

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 = <<__EOD__
# SYNOPSIS
#   #{name}#{dump_inputparam(input)}
#
# ARGS
#{dump_inout_type(input, element_definitions).chomp}
#
# RETURNS
#{dump_inout_type(output, element_definitions).chomp}
#
__EOD__
  unless fault.empty?
    str <<<<__EOD__
# RAISES
#{dump_fault_type(fault, element_definitions)}
#
__EOD__
  end
  str
end

#ndq(ele) ⇒ Object


70
71
72
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 70

def ndq(ele)
  ele.nil? ? 'nil' : dq(ele)
end

#nsym(ele) ⇒ Object


78
79
80
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 78

def nsym(ele)
  ele.nil? ? 'nil' : sym(ele)
end

#sym(ele) ⇒ Object


74
75
76
# File 'lib/wsdl/soap/classDefCreatorSupport.rb', line 74

def sym(ele)
  ':' + ele.id2name
end