From: Justin Hunter Date: Tue, 22 Sep 2009 01:04:59 +0000 (-0700) Subject: return comments/options/extra when they are set X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=891cdee785473eba08a0b167d4f47410fd37c386;p=dbsrgits%2FSQL-Translator-2.0-ish.git return comments/options/extra when they are set --- diff --git a/lib/SQL/Translator/Object.pm b/lib/SQL/Translator/Object.pm index a6640b9..6236cea 100644 --- a/lib/SQL/Translator/Object.pm +++ b/lib/SQL/Translator/Object.pm @@ -43,15 +43,15 @@ class SQL::Translator::Object { auto_deref => 1, ); - multi method comments(Str $comment) { $self->add_comment($comment) } - multi method comments(ArrayRef $comments) { $self->add_comment($_) for @$comments } + multi method comments(Str $comment) { $self->add_comment($comment); $self->comments } + multi method comments(ArrayRef $comments) { $self->add_comment($_) for @$comments; $self->comments } multi method comments(Any $) { wantarray ? @{$self->_comments} : join "\n", $self->_comments } - multi method options(Str $option) { $self->add_option($option) } - multi method options(ArrayRef $options) { $self->add_option($_) for @$options } + multi method options(Str $option) { $self->add_option($option); $self->options } + multi method options(ArrayRef $options) { $self->add_option($_) for @$options; $self->options } multi method options(Any $) { wantarray ? @{$self->_options} : $self->_options } - multi method extra(Str $extra) { $self->get_extra($extra) } - multi method extra(HashRef $extra) { $self->_extra($extra) } + multi method extra(Str $extra) { $self->get_extra($extra); $self->extra } + multi method extra(HashRef $extra) { $self->_extra($extra); $self->extra } multi method extra(Any $) { wantarray ? %{$self->_extra} : $self->_extra } }