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 = URI.encode_www_form(form)
end

Instance Method Details

#content_typeObject



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

def content_type
  "application/x-www-form-urlencoded"
end

#to_strObject



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

def to_str
  @raw.to_s
end