lib/soaspec/exchange.rb in soaspec-0.0.73 vs lib/soaspec/exchange.rb in soaspec-0.0.74

- old
+ new

@@ -3,13 +3,16 @@ # Convenience methods to set Exchange specific properties module ExchangeAccessors # Set default exchange handler for this exchange # This is helpful for when you need a new exchange handler created for each exchange - def default_handler(handler_class, name = handler_class.to_s, params = {}) + def default_handler(handler_class, name = handler_class.to_s, params = '') define_method('default_handler_used') do - handler_class.new name, params + params_used = Hash[params.map do |k, param| + [k, param.is_a?(String) ? ERB.new(param).result(binding) : param] + end] + handler_class.new name, params_used end end end # This represents a request / response pair @@ -17,10 +20,10 @@ # What is returned is related to the response class Exchange extend ExchangeAccessors - # Class of Exchange Handler for which this exchange is made + # Instance of ExchangeHandler for which this exchange is made attr_accessor :exchange_handler # How many times to retry for a success attr_accessor :retry_count # Name used for displaying class attr_accessor :test_name \ No newline at end of file