deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 2/7] CIMI (Model::Base): make generated attr methods go through the [] methods
Date Sat, 06 Oct 2012 00:52:06 GMT
From: David Lutterkort <lutter@redhat.com>

---
 server/lib/cimi/models/base.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/cimi/models/base.rb b/server/lib/cimi/models/base.rb
index bb4a055..4c9b2dc 100644
--- a/server/lib/cimi/models/base.rb
+++ b/server/lib/cimi/models/base.rb
@@ -143,8 +143,8 @@ class CIMI::Model::Base
         base_schema.add_attributes!(names, attr_klass, &block)
       end
       names.each do |name|
-        define_method(name) { @attribute_values[name] }
-        define_method(:"#{name}=") { |newval| @attribute_values[name] = newval }
+        define_method(name) { self[name] }
+        define_method(:"#{name}=") { |newval| self[name] = newval }
       end
     end
 
-- 
1.7.7.6


Mime
View raw message