lib/soaspec/basic_soap_handler.rb in soaspec-0.0.14 vs lib/soaspec/basic_soap_handler.rb in soaspec-0.0.15
- old
+ new
@@ -68,11 +68,11 @@
# Used in together with Exchange request that passes such override parameters
def make_request(override_parameters)
test_values = override_parameters # Used in Erb
# Erb parses template file, executing Ruby code in `<% %>` blocks to work out final request
- test_values = test_values.transform_keys_to_symbols # Either string or symbol
+ test_values = test_values.transform_keys_to_symbols unless Soaspec::Environment.always_use_keys?
if @request_option == :template
request_body = File.read('template/' + template_name + '.xml')
render_body = ERB.new(request_body).result(binding)
@client.call(operation, xml: render_body) # Call the SOAP operation with the request XML provided
elsif @request_option == :hash
@@ -80,10 +80,10 @@
end
end
def default_hash=(hash)
@request_option = :hash
- @default_hash = hash
+ @default_hash = Soaspec::Environment.always_use_keys? ? hash.transform_keys_to_symbols : hash
end
def status_code_for(response)
response.http.code
end
\ No newline at end of file