Added _attributes class data to SQL::Translator::Schema::Object for sub classes
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Schema / Index.pm
index c41680f..d4902d8 100644 (file)
@@ -1,9 +1,9 @@
 package SQL::Translator::Schema::Index;
 
 # ----------------------------------------------------------------------
-# $Id: Index.pm,v 1.5 2003-06-06 22:34:46 kycl4rk Exp $
+# $Id: Index.pm,v 1.10 2004-11-05 13:19:31 grommit Exp $
 # ----------------------------------------------------------------------
-# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>
+# Copyright (C) 2002-4 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -46,14 +46,14 @@ Primary and unique keys are table constraints, not indices.
 =cut
 
 use strict;
-use Class::Base;
 use SQL::Translator::Schema::Constants;
 use SQL::Translator::Utils 'parse_list_arg';
 
-use base 'Class::Base';
+use base 'SQL::Translator::Schema::Object';
+
 use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
 
-$VERSION = 1.00;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/;
 
 my %VALID_INDEX_TYPE = (
     UNIQUE,    1,
@@ -62,7 +62,10 @@ my %VALID_INDEX_TYPE = (
 );
 
 # ----------------------------------------------------------------------
-sub init {
+
+__PACKAGE__->_attributes( qw/
+    name type fields table
+/);
 
 =pod
 
@@ -74,16 +77,6 @@ Object constructor.
 
 =cut
 
-    my ( $self, $config ) = @_;
-
-    for my $arg ( qw[ name type fields table ] ) {
-        next unless $config->{ $arg };
-        defined $self->$arg( $config->{ $arg } ) or return;
-    }
-
-    return $self;
-}
-
 # ----------------------------------------------------------------------
 sub fields {
 
@@ -255,6 +248,6 @@ sub DESTROY {
 
 =head1 AUTHOR
 
-Ken Y. Clark E<lt>kclark@cpan.orgE<gt>
+Ken Y. Clark E<lt>kclark@cpan.orgE<gt>.
 
 =cut