incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] CIMI: Added .singularize method to CIMI_element_name
Date Wed, 16 Nov 2011 13:10:09 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/cimi/model/schema.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/cimi/model/schema.rb b/server/lib/cimi/model/schema.rb
index 4bed002..9e010d3 100644
--- a/server/lib/cimi/model/schema.rb
+++ b/server/lib/cimi/model/schema.rb
@@ -132,11 +132,11 @@ class CIMI::Model::Schema
 
     private
     def struct
-      cname = "CIMI_#{json_name.upcase_first}"
+      cname = "CIMI_#{json_name.upcase_first.singularize}"
       if ::Struct.const_defined?(cname)
         ::Struct.const_get(cname)
       else
-        ::Struct.new("CIMI_#{json_name.upcase_first}",
+        ::Struct.new("CIMI_#{json_name.upcase_first.singularize}",
                      *@schema.attribute_names)
       end
     end
-- 
1.7.4.4


Mime
View raw message