incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1004998 - /incubator/deltacloud/trunk/client/lib/deltacloud.rb
Date Wed, 06 Oct 2010 12:04:04 GMT
Author: mfojtik
Date: Wed Oct  6 12:04:04 2010
New Revision: 1004998

URL: http://svn.apache.org/viewvc?rev=1004998&view=rev
Log:
Added method_missing for undefined attributes in client

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

Modified: incubator/deltacloud/trunk/client/lib/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/deltacloud.rb?rev=1004998&r1=1004997&r2=1004998&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/client/lib/deltacloud.rb Wed Oct  6 12:04:04 2010
@@ -149,6 +149,8 @@ module DeltaCloud
         c.instance_eval do
           attr_accessor :id
           attr_accessor :uri
+
+
         end
         obj = xml_to_class(c, item)
       end
@@ -162,6 +164,10 @@ module DeltaCloud
       obj.id = item['id']
       api = self
       c.instance_eval do
+        define_method :method_missing do |method|
+            warn "[WARNING] Method '#{method}' is not available for this resource (#{c.name})."
+            return nil
+        end
         define_method :client do
           api
         end



Mime
View raw message