lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.44 vs lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.45
- old
+ new
@@ -67,21 +67,25 @@
{
}
end
# Setup object to handle communicating with a particular SOAP WSDL
- # @param [Hash] specific_options Options defining SOAP request. WSDL, authentication, see http://savonrb.com/version2/globals.html for list of options
- def initialize(name, specific_options = {})
+ # @param [Hash] options Options defining SOAP request. WSDL, authentication, see http://savonrb.com/version2/globals.html for list of options
+ def initialize(name = self.class.to_s, options = {})
@default_hash = {}
@request_option = :hash
- set_remove_key(specific_options, :operation)
- set_remove_key(specific_options, :default_hash)
- set_remove_key(specific_options, :template_name)
- options = default_options.merge logging_options
- options.merge! savon_options
- options.merge!(specific_options)
- @client = Savon.client(options)
+ if name.is_a?(Hash) && options == {} # If name is not set
+ options = name
+ name = self.class.to_s
+ end
super
+ set_remove_key(options, :operation)
+ set_remove_key(options, :default_hash)
+ set_remove_key(options, :template_name)
+ merged_options = default_options.merge logging_options
+ merged_options.merge! savon_options
+ merged_options.merge!(options)
+ @client = Savon.client(merged_options)
end
# Used in together with Exchange request that passes such override parameters
def make_request(override_parameters)
test_values = override_parameters # Used in Erb
\ No newline at end of file