mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-12-15 00:01:02 -05:00
multipart: initialize @bytesize in the initializer (for object shape opt)
This commit is contained in:
parent
eb8c18ccda
commit
6d4266d4a4
@ -11,6 +11,7 @@ module HTTPX
|
||||
@buffer = "".b
|
||||
|
||||
@form = form
|
||||
@bytesize = 0
|
||||
@parts = to_parts(form)
|
||||
end
|
||||
|
||||
@ -42,6 +43,7 @@ module HTTPX
|
||||
aux << [key, val]
|
||||
end
|
||||
@form = form
|
||||
@bytesize = 0
|
||||
@parts = to_parts(form)
|
||||
@part_index = 0
|
||||
end
|
||||
@ -49,7 +51,6 @@ module HTTPX
|
||||
private
|
||||
|
||||
def to_parts(form)
|
||||
@bytesize = 0
|
||||
params = form.each_with_object([]) do |(key, val), aux|
|
||||
Transcoder.normalize_keys(key, val, MULTIPART_VALUE_COND) do |k, v|
|
||||
next if v.nil?
|
||||
|
||||
@ -24,7 +24,7 @@ module HTTPX
|
||||
@form: Enumerable[[Symbol | string, Object & multipart_nested_value]]
|
||||
@parts: Array[Object & _Reader]
|
||||
|
||||
def bytesize: () -> Integer
|
||||
attr_reader bytesize: Integer
|
||||
|
||||
def content_type: () -> String
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user