lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.38 vs lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.39
- old
+ new
@@ -81,11 +81,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 if Soaspec::Environment.always_use_keys?
+ test_values = test_values.transform_keys_to_symbols if Soaspec.always_use_keys?
begin
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
@@ -99,11 +99,11 @@
# Set the default hash representing data to be used in making a request
# This will set the @request_option instance variable too
def default_hash=(hash)
@request_option = :hash
- @default_hash = Soaspec::Environment.always_use_keys? ? hash.transform_keys_to_symbols : hash
+ @default_hash = Soaspec.always_use_keys? ? hash.transform_keys_to_symbols : hash
end
# @param [Hash] format Format of expected result
# @return [Object] Generic body to be displayed in error messages
def response_body(response, format: :hash)
@@ -144,10 +144,10 @@
# @param [String] xpath
# @return [String] Value inside element found through Xpath
def xpath_value_for(exchange: nil, xpath: nil)
raise ArgumentError unless exchange && xpath
result =
- if Soaspec::Environment.strip_namespaces? && !xpath.include?(':')
+ if Soaspec.strip_namespaces? && !xpath.include?(':')
temp_doc = exchange.response.doc
temp_doc.remove_namespaces!
temp_doc.xpath(xpath).first
else
exchange.response.xpath(xpath).first
\ No newline at end of file