Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

+ EndPoint params merge with Request params

  • Loading branch information...
commit ecca4a2d769b0b88766c0a5d1b683279e01d8ae5 1 parent 7365255
Dirk Geurs authored April 15, 2011

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  lib/rufus/verbs/endpoint.rb
14  lib/rufus/verbs/endpoint.rb
@@ -270,11 +270,19 @@ def compute_target (opts)
270 270
       opts[:host] = r[1] || @opts[:host]
271 271
       opts[:port] = r[2] || @opts[:port]
272 272
       opts[:path] = r[3] || @opts[:path]
273  
-
  273
+      
  274
+      # Merge EndPoint params and Request params
  275
+      
  276
+      def_params = @opts[:query] || @opts[:params]
  277
+      req_params = opts[:query] || opts[:params]
  278
+      
  279
+      mer_params = def_params.merge req_params if def_params && req_params
  280
+      
274 281
       opts[:query] =
275 282
         r[4] ||
276  
-        opts[:params] || opts[:query] ||
277  
-        @opts[:query] || @opts[:params] ||
  283
+        mer_params ||
  284
+        req_params ||
  285
+        def_params ||
278 286
         {}
279 287
 
280 288
       opts.delete :path if opts[:path] == ''

0 notes on commit ecca4a2

Please sign in to comment.
Something went wrong with that request. Please try again.