Class: HTTPX::Plugins::Multipart::FormTranscoder::Encoder
- Inherits:
-
Object
- Object
- HTTPX::Plugins::Multipart::FormTranscoder::Encoder
- Extended by:
- Forwardable
- Defined in:
- lib/httpx/plugins/multipart.rb
Instance Method Summary collapse
- #bytesize ⇒ Object
- #force_encoding(*args) ⇒ Object
-
#initialize(form) ⇒ Encoder
constructor
A new instance of Encoder.
- #to_str ⇒ Object
Constructor Details
#initialize(form) ⇒ Encoder
Returns a new instance of Encoder.
25 26 27 |
# File 'lib/httpx/plugins/multipart.rb', line 25 def initialize(form) @raw = HTTP::FormData.create(form) end |
Instance Method Details
#bytesize ⇒ Object
29 30 31 |
# File 'lib/httpx/plugins/multipart.rb', line 29 def bytesize @raw.content_length end |
#force_encoding(*args) ⇒ Object
33 34 35 |
# File 'lib/httpx/plugins/multipart.rb', line 33 def force_encoding(*args) @raw.to_s.force_encoding(*args) end |
#to_str ⇒ Object
37 38 39 |
# File 'lib/httpx/plugins/multipart.rb', line 37 def to_str @raw.to_s end |