You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2012/10/06 02:52:06 UTC

[PATCH 2/7] CIMI (Model::Base): make generated attr methods go through the [] methods

From: David Lutterkort <lu...@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