Module: WashOut::SOAP::ClassMethods

Defined in:
lib/wash_out/soap.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#soap_actionsObject

Returns the value of attribute soap_actions.



8
9
10
# File 'lib/wash_out/soap.rb', line 8

def soap_actions
  @soap_actions
end

Instance Method Details

#soap_action(action, options = {}) ⇒ Object

Define a SOAP action action. The function has two required options: :args and :return. Each is a type definition of format described in WashOut::Param#parse_def.

An optional option :to can be passed to allow for names of SOAP actions which are not valid Ruby function names.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/wash_out/soap.rb', line 16

def soap_action(action, options={})
  if action.is_a?(Symbol)
    if WashOut::Engine.camelize_wsdl.to_s == 'lower'
      options[:to] ||= action.to_s
      action         = action.to_s.camelize(:lower)
    elsif WashOut::Engine.camelize_wsdl
      options[:to] ||= action.to_s
      action         = action.to_s.camelize
    end
  end

  self.soap_actions[action] = {
    :in     => WashOut::Param.parse_def(options[:args]),
    :out    => WashOut::Param.parse_def(options[:return]),
    :to     => options[:to] || action
  }
end