incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1040049 - /incubator/deltacloud/trunk/client/lib/base_object.rb
Date Mon, 29 Nov 2010 09:57:12 GMT
Author: mfojtik
Date: Mon Nov 29 09:57:12 2010
New Revision: 1040049

URL: http://svn.apache.org/viewvc?rev=1040049&view=rev
Log:
Allow client object actions take arguments.

Modified:
    incubator/deltacloud/trunk/client/lib/base_object.rb

Modified: incubator/deltacloud/trunk/client/lib/base_object.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/base_object.rb?rev=1040049&r1=1040048&r2=1040049&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/base_object.rb (original)
+++ incubator/deltacloud/trunk/client/lib/base_object.rb Mon Nov 29 09:57:12 2010
@@ -172,7 +172,7 @@ module DeltaCloud
           base_method_handler(m, args)
         rescue NoHandlerForMethod
           case m[:type]
-            when :action_link then do_action(m)
+            when :action_link then do_action(m, args)
             else raise NoHandlerForMethod
           end
         end
@@ -180,8 +180,13 @@ module DeltaCloud
 
       private
 
-      def do_action(m)
-        @client.request(:"#{m[:method]}", m[:href], {}, {})
+      def do_action(m, args)
+        args = args.first || {}
+        method = m[:method].to_sym
+        @client.request(method,
+                        m[:href],
+                        method == :get ? args : {},
+                        method == :get ? {} : args)
         action_trigger(m[:rel])
       end
 



Mime
View raw message