lib/httpx/plugins/ntlm_authentication.rb in httpx-0.15.4 vs lib/httpx/plugins/ntlm_authentication.rb in httpx-0.16.0
- old
+ new
@@ -13,16 +13,18 @@
require "base64"
require "ntlm"
end
def extra_options(options)
- Class.new(options.class) do
- def_option(:ntlm, <<-OUT)
- raise Error, ":ntlm must be a #{NTLMParams}" unless value.is_a?(#{NTLMParams})
+ options.merge(max_concurrent_requests: 1)
+ end
+ end
- value
- OUT
- end.new(options).merge(max_concurrent_requests: 1)
+ module OptionsMethods
+ def option_ntlm(value)
+ raise TypeError, ":ntlm must be a #{NTLMParams}" unless value.is_a?(NTLMParams)
+
+ value
end
end
module InstanceMethods
def ntlm_authentication(user, password, domain = nil)