Parent

Methods

Hash

Extension to Hash to create URL encoded string from key-values

Public Instance Methods

to_http_str() click to toggle source

Returns string formatted for HTTP URL encoded name-value pairs. For example,

 {:id => 'thomas_hardy'}.to_http_str 
 # => "id=thomas_hardy"
 {:id => 23423, :since => Time.now}.to_http_str
 # => "since=Thu,%2021%20Jun%202007%2012:10:05%20-0500&id=23423"
    # File lib/twitter/ext/stdlib.rb, line 11
11:   def to_http_str
12:     result = ''
13:     return result if self.empty?
14:     self.each do |key, val|
15:       result << "#{key}=#{CGI.escape(val.to_s)}&"
16:     end
17:     result.chop # remove the last '&' character, since it can be discarded
18:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.