Class: WSDL::SOAP::MethodDefCreator

Inherits:
Object
  • Object
show all
Includes:
ClassDefCreatorSupport
Defined in:
lib/wsdl/soap/methodDefCreator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassDefCreatorSupport

#assign_const, #basetype_mapped_class, #create_type_name, #dq, #dqname, #dump_method_signature, #mapped_class_basename, #mapped_class_name, #ndq, #nsym, #sym

Methods included from XSD::CodeGen::GenSupport

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

Constructor Details

#initialize(definitions, name_creator, modulepath, defined_const) ⇒ MethodDefCreator

Returns a new instance of MethodDefCreator.



28
29
30
31
32
33
34
35
36
37
# File 'lib/wsdl/soap/methodDefCreator.rb', line 28

def initialize(definitions, name_creator, modulepath, defined_const)
  @definitions = definitions
  @name_creator = name_creator
  @modulepath = modulepath
  @simpletypes = @definitions.collect_simpletypes
  @complextypes = @definitions.collect_complextypes
  @elements = @definitions.collect_elements
  @defined_const = defined_const
  @assigned_method = {}
end

Instance Attribute Details

#assigned_methodObject (readonly)

TODO: should not export this kind of stateful information. will be rewwritten in 1.6.1



26
27
28
# File 'lib/wsdl/soap/methodDefCreator.rb', line 26

def assigned_method
  @assigned_method
end

#definitionsObject (readonly)

Returns the value of attribute definitions.



23
24
25
# File 'lib/wsdl/soap/methodDefCreator.rb', line 23

def definitions
  @definitions
end

Instance Method Details

#create(bindingname) ⇒ Object



52
53
54
55
56
57
58
59
60
61
# File 'lib/wsdl/soap/methodDefCreator.rb', line 52

def create(bindingname)
  binding = @definitions.binding(bindingname)
  if binding
    return binding.operations.collect { |op_bind|
      next unless op_bind.soapoperation # not a SOAP operation binding
      create_methoddef(op_bind)
    }
  end
  nil
end

#dump(name) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/wsdl/soap/methodDefCreator.rb', line 39

def dump(name)
  methoddef = ""
  porttype = @definitions.porttype(name)
  binding = porttype.find_binding
  if binding
    create(binding.name).each do |mdef|
      methoddef << ",\n" unless methoddef.empty?
      methoddef << dump_method(mdef).chomp
    end
  end
  methoddef
end