Class: WSDL::SOAP::ClientSkeltonCreator

Inherits:
Object
  • Object
show all
Includes:
ClassDefCreatorSupport
Defined in:
lib/wsdl/soap/clientSkeltonCreator.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 = nil) ⇒ ClientSkeltonCreator

Returns a new instance of ClientSkeltonCreator.



23
24
25
26
27
# File 'lib/wsdl/soap/clientSkeltonCreator.rb', line 23

def initialize(definitions, name_creator, modulepath = nil)
  @definitions = definitions
  @name_creator = name_creator
  @modulepath = modulepath
end

Instance Attribute Details

#definitionsObject (readonly)

Returns the value of attribute definitions.



21
22
23
# File 'lib/wsdl/soap/clientSkeltonCreator.rb', line 21

def definitions
  @definitions
end

Instance Method Details

#dump(service_name) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/wsdl/soap/clientSkeltonCreator.rb', line 29

def dump(service_name)
  services = @definitions.service(service_name)
  unless services
    raise RuntimeError.new("service not defined: #{service_name}")
  end
  result = ""
  if @modulepath
    result << "\n"
    modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above      
    result << modulepath.collect { |ele| "module #{ele}" }.join("; ")
    result << "\n\n"
  end
  services.ports.each do |port|
    result << dump_porttype(port.porttype)
    result << "\n"
  end
  if @modulepath
    result << "\n\n"
    modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above      
    result << modulepath.collect { |ele| "end" }.join("; ")
    result << "\n"
  end
  result
end