mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-12-07 00:00:31 -05:00
backporting infinite method
This commit is contained in:
parent
7ee4c5f6d3
commit
d92de449ef
@ -34,6 +34,7 @@ module HTTPX
|
|||||||
include Callbacks
|
include Callbacks
|
||||||
|
|
||||||
using URIExtensions
|
using URIExtensions
|
||||||
|
using NumericExtensions
|
||||||
|
|
||||||
require "httpx/connection/http2"
|
require "httpx/connection/http2"
|
||||||
require "httpx/connection/http1"
|
require "httpx/connection/http1"
|
||||||
|
|||||||
@ -54,6 +54,14 @@ module HTTPX
|
|||||||
Numeric.__send__(:include, NegMethods)
|
Numeric.__send__(:include, NegMethods)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module NumericExtensions
|
||||||
|
refine Numeric do
|
||||||
|
def infinite?
|
||||||
|
self == Float::INFINITY
|
||||||
|
end unless Numeric.method_defined?(:infinite?)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module StringExtensions
|
module StringExtensions
|
||||||
refine String do
|
refine String do
|
||||||
def delete_suffix!(suffix)
|
def delete_suffix!(suffix)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user