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/09/21 23:50:58 UTC

[PATCH 02/10] CIMI (models/schema): allow passing options to href

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