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.



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

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.



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

def fault
  @fault
end

#inputObject (readonly)

Returns the value of attribute input.



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

def input
  @input
end

#nameObject (readonly)

required



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

def name
  @name
end

#outputObject (readonly)

Returns the value of attribute output.



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

def output
  @output
end

#parameter_orderObject (readonly)

optional



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

def parameter_order
  @parameter_order
end

#typeObject (readonly)

required



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

def type
  @type
end

Instance Method Details

#inputnameObject



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

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

#inputpartsObject

TODO: remove once after OperationInfo created



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

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

#operationnameObject



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

def operationname
  as_operationname(@name)
end

#outputnameObject



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

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

#outputpartsObject

TODO: remove once after OperationInfo created



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

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

#parse_attr(attr, value) ⇒ Object



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

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



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

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



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

def targetnamespace
  parent.targetnamespace
end