From: Justin Hunter Date: Mon, 24 Aug 2009 21:59:07 +0000 (-0700) Subject: add wantarray for return and only push new options on if array has elements X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0acbba1d1037fe7b8a9423642e3a80489c508612;p=dbsrgits%2FSQL-Translator-2.0-ish.git add wantarray for return and only push new options on if array has elements --- diff --git a/lib/SQL/Translator/Object.pm b/lib/SQL/Translator/Object.pm index cc6f5aa..af3ad53 100644 --- a/lib/SQL/Translator/Object.pm +++ b/lib/SQL/Translator/Object.pm @@ -33,6 +33,6 @@ class SQL::Translator::Object { multi method comments(Any $) { return wantarray ? @{$self->_comments} : join "\n", $self->_comments } multi method options(Str $option) { $self->add_option($option) } - multi method options(ArrayRef $option) { $self->add_option($option) } - multi method options(Any $) { $self->_options } + multi method options(ArrayRef $option) { $self->add_option($option) if scalar @$option } + multi method options(Any $) { wantarray ? @{$self->_options} : $self->_options } }