Class: WSDL::Operation

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

Defined Under Namespace

Classes: NameInfo

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.


34
35
36
37
38
39
40
41
42
# File 'lib/wsdl/operation.rb', line 34

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


31
32
33
# File 'lib/wsdl/operation.rb', line 31

def fault
  @fault
end

#inputObject (readonly)

Returns the value of attribute input


29
30
31
# File 'lib/wsdl/operation.rb', line 29

def input
  @input
end

#nameObject (readonly)

required


27
28
29
# File 'lib/wsdl/operation.rb', line 27

def name
  @name
end

#outputObject (readonly)

Returns the value of attribute output


30
31
32
# File 'lib/wsdl/operation.rb', line 30

def output
  @output
end

#parameter_orderObject (readonly)

optional


28
29
30
# File 'lib/wsdl/operation.rb', line 28

def parameter_order
  @parameter_order
end

#typeObject (readonly)

required


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

def type
  @type
end

Instance Method Details

#input_infoObject


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

def input_info
  if message = input_message
    typename = message.name
  else
    typename = nil
  end
  NameInfo.new(operationname, typename, inputparts)
end

#inputnameObject


79
80
81
82
83
84
85
# File 'lib/wsdl/operation.rb', line 79

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

#inputpartsObject


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

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

#operationnameObject


48
49
50
# File 'lib/wsdl/operation.rb', line 48

def operationname
  as_operationname(@name)
end

#output_infoObject


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

def output_info
  if message = output_message
    typename = message.name
  else
    typename = nil
  end
  NameInfo.new(operationname, typename, outputparts)
end

#outputnameObject


95
96
97
98
99
100
101
# File 'lib/wsdl/operation.rb', line 95

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

#outputpartsObject


87
88
89
90
91
92
93
# File 'lib/wsdl/operation.rb', line 87

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

#parse_attr(attr, value) ⇒ Object


125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/wsdl/operation.rb', line 125

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


103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/wsdl/operation.rb', line 103

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


44
45
46
# File 'lib/wsdl/operation.rb', line 44

def targetnamespace
  parent.targetnamespace
end