package SQL::Translator::Schema::Table;
# ----------------------------------------------------------------------
-# $Id: Table.pm,v 1.7 2003-06-06 22:36:09 kycl4rk Exp $
+# $Id: Table.pm,v 1.12 2003-08-20 16:08:13 kycl4rk Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>
#
use base 'Class::Base';
use vars qw( $VERSION $FIELD_ORDER );
-$VERSION = 1.00;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/;
# ----------------------------------------------------------------------
sub init {
=cut
- my $self = shift;
- push @{ $self->{'comments'} }, @_ if @_;
+ my $self = shift;
+ my @comments = ref $_[0] ? @{ $_[0] } : @_;
+
+ for my $arg ( @comments ) {
+ $arg = $arg->[0] if ref $arg;
+ push @{ $self->{'comments'} }, $arg if defined $arg && $arg;
+ }
- return wantarray
- ? @{ $self->{'comments'} || [] }
- : join( "\n", @{ $self->{'comments'} || [] } );
+ if ( @{ $self->{'comments'} || [] } ) {
+ return wantarray
+ ? @{ $self->{'comments'} }
+ : join( "\n", @{ $self->{'comments'} } )
+ ;
+ }
+ else {
+ return wantarray ? () : undef;
+ }
}
# ----------------------------------------------------------------------