deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [6/10] git commit: CIMI (models/schema): allow passing options to href
Date Mon, 24 Sep 2012 23:52:48 GMT
CIMI (models/schema): allow passing options to href

This way, we can change the xml or json name of the enclosing tags


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

Branch: refs/heads/master
Commit: 6efdde59e6f88bfb60fb27e423887fb04b4db778
Parents: 302f67e
Author: David Lutterkort <lutter@redhat.com>
Authored: Tue Sep 18 13:37:21 2012 -0700
Committer: David Lutterkort <lutter@redhat.com>
Committed: Mon Sep 24 16:33:40 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6efdde59/server/lib/cimi/models/schema.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb
index a02b5a6..f5097e0 100644
--- a/server/lib/cimi/models/schema.rb
+++ b/server/lib/cimi/models/schema.rb
@@ -266,7 +266,8 @@ class CIMI::Model::Schema
   # +add_attributes!+ method
   module DSL
     def href(*args)
-      args.each { |arg| struct(arg) { scalar :href } }
+      opts = args.extract_opts!
+      args.each { |arg| struct(arg, opts) { scalar :href } }
     end
 
     def text(*args)


Mime
View raw message