On Fri, 2011-06-03 at 09:38 -0400, Chris Lalancette wrote:
> It seems pretty odd that param initialization can do
> different things depending on the type of the 3rd argument.
> I think it is easier to understand if the 3rd argument always
> means 'options', and the 4th argument always means 'description'.
>
> Luckily most of the callers were already conforming to this
> pattern; just a few of them had to be changed to add an additional
> argument between the [:required, :optional] declaration and
> the description.
>
> Along with this, rationalize the param declarations in features.rb
> so that the options are set to [], instead of nil. This matches
> what param declarations do by default.
>
> Signed-off-by: Chris Lalancette <[email protected]>
ACK. It would have been cleaner to pass the description and default
value in as a hash from the get-go, but this is good enough as a code
clarification.
What I mean with the hash is sth like
param :name, :string, :optional, :default => "foo", :descr => "The
user-defined name"
but that can be fixed up at some later point.
David