deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [7/9] git commit: CIMI: Added ref_id helper to Base class
Date Mon, 25 Feb 2013 19:23:01 GMT
CIMI: Added ref_id helper to Base class

The ref_id(url) will extract the last segment of the
URL and return it as an 'id'.

FIXME: We should use ctx to return the ID of resource properly.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/90eb17744273b3e64b01808f7692fe57c4cff097


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/f6536dea
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/f6536dea
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/f6536dea

Branch: refs/heads/master
Commit: f6536dea93df84c99be6b6492d861caed8bf9c70
Parents: e8942f4
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Feb 22 13:35:18 2013 +0100
Committer: David Lutterkort <lutter@redhat.com>
Committed: Mon Feb 25 11:22:37 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/f6536dea/server/lib/cimi/models/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/base.rb b/server/lib/cimi/models/base.rb
index 04a1098..4b03495 100644
--- a/server/lib/cimi/models/base.rb
+++ b/server/lib/cimi/models/base.rb
@@ -165,6 +165,10 @@ module CIMI::Model
       property.merge!(h)
     end
 
+    def ref_id(ref_url)
+      ref_url.split('/').last if ref_url
+    end
+
     private
 
     # Load an existing database entity for this object, or create a new one


Mime
View raw message