mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
fixes on existing plugin option checks
This commit is contained in:
parent
daf9fcee1d
commit
7819079b71
@ -267,7 +267,7 @@ module HTTPX
|
|||||||
instance_variables.each do |ivar|
|
instance_variables.each do |ivar|
|
||||||
value = other.instance_variable_get(ivar)
|
value = other.instance_variable_get(ivar)
|
||||||
value = case value
|
value = case value
|
||||||
when Symbol, Fixnum, TrueClass, FalseClass # rubocop:disable Lint/UnifiedInteger
|
when Symbol, Numeric, TrueClass, FalseClass
|
||||||
value
|
value
|
||||||
else
|
else
|
||||||
value.dup
|
value.dup
|
||||||
|
@ -22,7 +22,7 @@ module HTTPX
|
|||||||
|
|
||||||
module OptionsMethods
|
module OptionsMethods
|
||||||
def option_expect_timeout(value)
|
def option_expect_timeout(value)
|
||||||
seconds = Integer(value)
|
seconds = Float(value)
|
||||||
raise TypeError, ":expect_timeout must be positive" unless seconds.positive?
|
raise TypeError, ":expect_timeout must be positive" unless seconds.positive?
|
||||||
|
|
||||||
seconds
|
seconds
|
||||||
|
@ -67,7 +67,7 @@ module HTTPX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def option_retry_on(value)
|
def option_retry_on(value)
|
||||||
raise ":retry_on must be called with the response" unless value.respond_to?(:call)
|
raise TypeError, ":retry_on must be called with the response" unless value.respond_to?(:call)
|
||||||
|
|
||||||
value
|
value
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user