Class: WSDL::Operation

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

Constant Summary collapse

EMPTY =
[].freeze

Instance Attribute Summary collapse

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initializeOperation

Returns a new instance of Operation.



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

def initialize
  super
  @name = nil
  @type = nil
  @parameter_order = nil
  @input = nil
  @output = nil
  @fault = []
end

Instance Attribute Details

#faultObject (readonly)

Returns the value of attribute fault.



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

def fault
  @fault
end

#inputObject (readonly)

Returns the value of attribute input.



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

def input
  @input
end

#nameObject (readonly)

required



16
17
18
# File 'lib/wsdl/operation.rb', line 16

def name
  @name
end

#outputObject (readonly)

Returns the value of attribute output.



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

def output
  @output
end

#parameter_orderObject (readonly)

optional



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

def parameter_order
  @parameter_order
end

#typeObject (readonly)

required



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

def type
  @type
end

Instance Method Details

#inputnameObject



51
52
53
54
55
56
57
# File 'lib/wsdl/operation.rb', line 51

def inputname
  if input
    as_operationname(input.name ? input.name.name : @name)
  else
    nil
  end
end

#inputpartsObject

TODO: remove once after OperationInfo created



43
44
45
46
47
48
49
# File 'lib/wsdl/operation.rb', line 43

def inputparts
  if message = input_message
    sort_parts(message.parts)
  else
    EMPTY
  end
end

#operationnameObject



37
38
39
# File 'lib/wsdl/operation.rb', line 37

def operationname
  as_operationname(@name)
end

#outputnameObject



68
69
70
71
72
73
74
# File 'lib/wsdl/operation.rb', line 68

def outputname
  if output
    as_operationname(output.name ? output.name.name : @name + 'Response')
  else
    nil
  end
end

#outputpartsObject

TODO: remove once after OperationInfo created



60
61
62
63
64
65
66
# File 'lib/wsdl/operation.rb', line 60

def outputparts
  if message = output_message
    sort_parts(message.parts)
  else
    EMPTY
  end
end

#parse_attr(attr, value) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/wsdl/operation.rb', line 98

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = value.source
  when TypeAttrName
    @type = value
  when ParameterOrderAttrName
    @parameter_order = value.source.split(/\s+/)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/wsdl/operation.rb', line 76

def parse_element(element)
  case element
  when InputName
    o = Param.new
    @input = o
    o
  when OutputName
    o = Param.new
    @output = o
    o
  when FaultName
    o = Param.new
    @fault << o
    o
  when DocumentationName
    o = Documentation.new
    o
  else
    nil
  end
end

#targetnamespaceObject



33
34
35
# File 'lib/wsdl/operation.rb', line 33

def targetnamespace
  parent.targetnamespace
end