incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammed Morsi <mmo...@redhat.com>
Subject [PATCH] support array request param types with ability to specify type of array elements
Date Wed, 04 Aug 2010 20:03:23 GMT
---
 server/lib/deltacloud/validation.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/validation.rb b/server/lib/deltacloud/validation.rb
index b4eb3ae..33b0c45 100644
--- a/server/lib/deltacloud/validation.rb
+++ b/server/lib/deltacloud/validation.rb
@@ -13,11 +13,12 @@ module Deltacloud::Validation
   end
 
   class Param
-    attr_reader :name, :klass, :type, :options, :description
+    attr_reader :name, :klass, :array_klass, :type, :options, :description
 
     def initialize(args)
       @name = args[0]
       @klass = args[1] || :string
+      @array_klass = args.delete_at(2) if @klass == :array
       @type = args[2] || :optional
       @options = args[3] || []
       @description = args[4] || ''
-- 
1.7.2


Mime
View raw message