Class: WSDL::Param

Inherits:
Info show all
Defined in:
lib/wsdl/param.rb

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initializeParam

Returns a new instance of Param.



23
24
25
26
27
28
29
30
# File 'lib/wsdl/param.rb', line 23

def initialize
  super
  @message = nil
  @name = nil
  @soapbody = nil
  @soapheader = []
  @soapfault = nil
end

Instance Attribute Details

#messageObject (readonly)

required



17
18
19
# File 'lib/wsdl/param.rb', line 17

def message
  @message
end

#nameObject (readonly)

optional but required for fault.



18
19
20
# File 'lib/wsdl/param.rb', line 18

def name
  @name
end

#soapbodyObject (readonly)

Returns the value of attribute soapbody.



19
20
21
# File 'lib/wsdl/param.rb', line 19

def soapbody
  @soapbody
end

#soapfaultObject (readonly)

Returns the value of attribute soapfault.



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

def soapfault
  @soapfault
end

#soapheaderObject (readonly)

Returns the value of attribute soapheader.



20
21
22
# File 'lib/wsdl/param.rb', line 20

def soapheader
  @soapheader
end

Instance Method Details

#find_messageObject



36
37
38
# File 'lib/wsdl/param.rb', line 36

def find_message
  root.message(@message) or raise RuntimeError.new("#{@message} not found")
end

#parse_attr(attr, value) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/wsdl/param.rb', line 78

def parse_attr(attr, value)
  case attr
  when MessageAttrName
    if value.namespace.nil?
      value = XSD::QName.new(targetnamespace, value.source)
    end
    @message = value
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/wsdl/param.rb', line 56

def parse_element(element)
  case element
  when SOAPBodyName
    o = WSDL::SOAP::Body.new
    @soapbody = o
    o
  when SOAPHeaderName
    o = WSDL::SOAP::Header.new
    @soapheader << o
    o
  when SOAPFaultName
    o = WSDL::SOAP::Fault.new
    @soapfault = o
    o
  when DocumentationName
    o = Documentation.new
    o
  else
    nil
  end
end

#soapbody_encodingstyleObject



48
49
50
51
52
53
54
# File 'lib/wsdl/param.rb', line 48

def soapbody_encodingstyle
  if @soapbody
    @soapbody.encodingstyle
  else
    nil
  end
end

#soapbody_useObject



40
41
42
43
44
45
46
# File 'lib/wsdl/param.rb', line 40

def soapbody_use
  if @soapbody
    @soapbody.use || :literal
  else
    nil
  end
end

#targetnamespaceObject



32
33
34
# File 'lib/wsdl/param.rb', line 32

def targetnamespace
  parent.targetnamespace
end