deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 2/9] CIMI (models/schema): allow passing options to href
Date Wed, 19 Sep 2012 02:54:02 GMT
From: David Lutterkort <lutter@redhat.com>

This way, we can change the xml or json name of the enclosing tags
---
 server/lib/cimi/models/schema.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb
index 878014e..7592d1c 100644
--- a/server/lib/cimi/models/schema.rb
+++ b/server/lib/cimi/models/schema.rb
@@ -259,7 +259,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)
-- 
1.7.7.6


Mime
View raw message