Class: HTTPX::Transcoder::Form::Encoder

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

Instance Method Summary collapse

Constructor Details

#initialize(form) ⇒ Encoder

Returns a new instance of Encoder.



19
20
21
# File 'lib/httpx/transcoder/form.rb', line 19

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

Instance Method Details

#bytesizeObject



23
24
25
# File 'lib/httpx/transcoder/form.rb', line 23

def bytesize
  @raw.content_length
end

#force_encoding(*args) ⇒ Object



27
28
29
# File 'lib/httpx/transcoder/form.rb', line 27

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

#to_strObject



31
32
33
# File 'lib/httpx/transcoder/form.rb', line 31

def to_str
  @raw.to_s
end