class HTTPX::Transcoder::Form::Encoder

  1. lib/httpx/transcoder/form.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. content_type

Public Class methods

new(form)
[show source]
   # File lib/httpx/transcoder/form.rb
23 def initialize(form)
24   @raw = form.each_with_object("".b) do |(key, val), buf|
25     HTTPX::Transcoder.normalize_keys(key, val) do |k, v|
26       buf << "&" unless buf.empty?
27       buf << URI.encode_www_form_component(k)
28       buf << "=#{URI.encode_www_form_component(v.to_s)}" unless v.nil?
29     end
30   end
31 end

Public Instance methods

content_type()
[show source]
   # File lib/httpx/transcoder/form.rb
33 def content_type
34   "application/x-www-form-urlencoded"
35 end