lib/hello_sign/client.rb in hellosign-ruby-sdk-3.0.2 vs lib/hello_sign/client.rb in hellosign-ruby-sdk-3.0.3

- old
+ new

@@ -101,10 +101,11 @@ end private def request(path, method, options={}) + strip_options_whitespace(options) make_connection(options).send method do |request| if options[:oauth_request] request.url "#{path}", options[:params] else request.url "#{api_version}#{path}", options[:params] @@ -187,9 +188,22 @@ prepare opts, :signers end def prepare_ccs opts prepare opts, :ccs + end + + def strip_options_whitespace(hash) + hash.each do |k, v| + case v + when String + v.strip! + when Array + v.each {|av| av.strip!} + when Hash + strip_options_whitespace(v) + end + end end def prepare opts, key return unless opts[key] opts[key].each_with_index do |value, index|