Class: HTTPX::Plugins::Multipart::FormTranscoder::Encoder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/httpx/plugins/multipart.rb

Instance Method Summary collapse

Constructor Details

#initialize(form) ⇒ Encoder

Returns a new instance of Encoder.



18
19
20
# File 'lib/httpx/plugins/multipart.rb', line 18

def initialize(form)
  @raw = HTTP::FormData.create(form)
end

Instance Method Details

#bytesizeObject



22
23
24
# File 'lib/httpx/plugins/multipart.rb', line 22

def bytesize
  @raw.content_length
end

#force_encoding(*args) ⇒ Object



26
27
28
# File 'lib/httpx/plugins/multipart.rb', line 26

def force_encoding(*args)
  @raw.to_s.force_encoding(*args)
end

#to_strObject



30
31
32
# File 'lib/httpx/plugins/multipart.rb', line 30

def to_str
  @raw.to_s
end