You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2010/11/29 10:57:12 UTC
svn commit: r1040049 - /incubator/deltacloud/trunk/client/lib/base_object.rb
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