lib/savon/soap.rb in savon-0.6.3 vs lib/savon/soap.rb in savon-0.6.4
- old
+ new
@@ -27,25 +27,27 @@
@version = version if Savon::SOAPVersions.include? version
end
end
- # Expects a Hash containing the name of the SOAP action and input.
- def initialize(action = nil)
- @action = action.kind_of?(Hash) ? action[:name] : ""
- @input = action.kind_of?(Hash) ? action[:input] : ""
- end
-
# Sets the WSSE options.
attr_writer :wsse
# Accessor for the SOAP action.
- attr_accessor :action
+ attr_writer :action
+ def action
+ @action ||= ""
+ end
+
# Accessor for the SOAP input.
attr_writer :input
+ def input
+ @input ||= ""
+ end
+
# Sets the SOAP header. Expected to be a Hash that can be translated
# to XML via Hash.to_soap_xml or any other Object responding to to_s.
attr_writer :header
# Returns the SOAP header. Defaults to an empty Hash.
@@ -100,11 +102,11 @@
# Returns an Array of SOAP input names to append to the :wsdl namespace.
# Defaults to use the name of the SOAP action and may be an empty Array
# in case the specified SOAP input seems invalid.
def input_array
- return [@input.to_sym] if @input && !@input.empty?
- return [@action.to_sym] if @action && !@action.empty?
+ return [input.to_sym] if input && !input.empty?
+ return [action.to_sym] if action && !action.empty?
[]
end
# Returns the WSSE header or an empty String in case WSSE was not set.
def wsse_header