mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
fixing usage of Enumerable#sum for older rubies
This commit is contained in:
parent
7fa283097d
commit
1691f50af5
@ -15,8 +15,14 @@ module HTTPX::Plugins
|
||||
"multipart/form-data; boundary=#{@boundary}"
|
||||
end
|
||||
|
||||
def bytesize
|
||||
@parts.map(&:size).sum
|
||||
if RUBY_VERSION > "2.3"
|
||||
def bytesize
|
||||
@parts.map(&:size).sum
|
||||
end
|
||||
else
|
||||
def bytesize
|
||||
@parts.map(&:size).reduce(0, :+)
|
||||
end
|
||||
end
|
||||
|
||||
def read(length = nil, outbuf = nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user