incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH] support array request param types with ability to specify type of array elements
Date Thu, 05 Aug 2010 08:27:47 GMT
On 04/08/10 16:03 -0400, Mohammed Morsi wrote:
>---
> 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

ACK.

Seems good, applied cleanly.

  -- Michal

-- 
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com, +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Mime
View raw message