add self to credits
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBObject.pm
index 1e6df30..09bbbf0 100644 (file)
@@ -35,6 +35,7 @@ __PACKAGE__->mk_group_accessors(simple => qw/
 
 use overload
     '""' => sub { $_[0]->name },
+    '@{}' => sub { $_[0]->name_parts },
     fallback => 1;
 
 =head2 new
@@ -153,14 +154,28 @@ sub dbic_name {
     return $self->name;
 }
 
+=head2 name_parts
+
+Returns an arrayref of the values returned by the methods specified in
+the L<moniker_parts|DBIx::Class::Schema::Loader::Base/moniker_parts> of
+the L</loader> object. The object arrayrefifies to this value.
+
+=cut
+
+sub name_parts {
+    my ($self) = shift;
+    return [ map { $self->$_ } @{$self->loader->moniker_parts} ];
+}
+
+
 =head1 SEE ALSO
 
 L<DBIx::Class::Schema::Loader::Table>, L<DBIx::Class::Schema::Loader>,
 L<DBIx::Class::Schema::Loader::Base>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHORS>.
 
 =head1 LICENSE