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.



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

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



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

def assigned_method
  @assigned_method
end

#definitionsObject (readonly)

Returns the value of attribute definitions.



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

def definitions
  @definitions
end

Instance Method Details

#create(bindingname) ⇒ Object



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

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



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

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