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 2012/10/11 10:33:28 UTC
[5/7] git commit: CIMI (Model::Base): make generated attr methods go
through the [] methods
CIMI (Model::Base): make generated attr methods go through the [] methods
TrackedAt: http://tracker.deltacloud.org/patch/7ee2535af19940cda2671ff2f43587d675b227ca
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/292dabf6
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/292dabf6
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/292dabf6
Branch: refs/heads/master
Commit: 292dabf68c4490c3c84da4182ef8cc2039721873
Parents: f968b23
Author: David Lutterkort <lu...@redhat.com>
Authored: Fri Oct 5 16:56:57 2012 -0700
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Oct 11 10:31:07 2012 +0200
----------------------------------------------------------------------
server/lib/cimi/models/base.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/292dabf6/server/lib/cimi/models/base.rb
----------------------------------------------------------------------
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