public
Rubygem
Description: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage:
Clone URL: git://github.com/jnunemaker/httparty.git
Click here to lend your support to: httparty and make a donation at www.pledgie.com !
Fixed redirection issue by removing memoization of uri.
jnunemaker (author)
Tue Nov 11 15:20:05 -0800 2008
commit  c3e2a57083f91b93bda22e7427307020d0ecacc3
tree    166abe4bcd97e4a02c14deb77c1365188b462b0b
parent  c6867ca01de950bf2dbb9c606b5af9ca245ee6ab
...
9
10
11
12
13
14
15
16
17
18
19
 
 
 
 
 
 
20
21
22
...
24
25
26
27
 
28
29
30
...
9
10
11
 
 
 
 
 
 
 
 
12
13
14
15
16
17
18
19
20
...
22
23
24
 
25
26
27
28
0
@@ -9,14 +9,12 @@ module HTTParty
0
     attr_accessor :http_method, :path, :options
0
     
0
     def initialize(http_method, path, options={})
0
-      options = {:limit => 5}.merge(options)
0
-      options[:limit] = 0 if options.delete(:no_follow)
0
-      options[:default_params] ||= {}
0
-
0
-      @http_method   = http_method
0
-
0
-      @path    = URI.parse(path)
0
-      @options = options
0
+      self.http_method = http_method
0
+      self.path = path
0
+      self.options = {
0
+        :limit => options.delete(:no_follow) ? 0 : 5, 
0
+        :default_params => {},
0
+      }.merge(options.dup)
0
     end
0
 
0
     def path=(uri)
0
@@ -24,7 +22,7 @@ module HTTParty
0
     end
0
 
0
     def uri
0
-      @uri ||= path.relative? ? URI.parse("#{options[:base_uri]}#{path}") : path
0
+      path.relative? ? URI.parse("#{options[:base_uri]}#{path}") : path
0
     end
0
 
0
     # FIXME: this method is doing way to much and needs to be split up

Comments