finishing off moveing UUIDColumns files from main DBIx dist
[dbsrgits/DBIx-Class-UUIDColumns.git] / lib / DBIx / Class / UUIDColumns / UUIDMaker / UUID.pm
CommitLineData
36ccab80 1package DBIx::Class::UUIDMaker::UUID;
2
3use strict;
4use warnings;
5
6use base qw/DBIx::Class::UUIDMaker/;
7use UUID ();
8
9sub as_string {
10 my ($uuid, $uuidstring);
11 UUID::generate($uuid);
12 UUID::unparse($uuid, $uuidstring);
13
14 return $uuidstring;
15};
16
171;
18__END__
19
20=head1 NAME
21
22DBIx::Class::UUIDMaker::UUID - Create uuids using UUID
23
24=head1 SYNOPSIS
25
26 package Artist;
27 __PACKAGE__->load_components(qw/UUIDColumns Core DB/);
28 __PACKAGE__->uuid_columns( 'artist_id' );
29 __PACKAGE__->uuid_class('::UUID');
30
31=head1 DESCRIPTION
32
33This DBIx::Class::UUIDMaker subclass uses UUID to generate uuid
34strings in the following format:
35
36 098f2470-bae0-11cd-b579-08002b30bfeb
37
38=head1 METHODS
39
40=head2 as_string
41
42Returns the new uuid as a string.
43
44=head1 SEE ALSO
45
46L<UUID>
47
48=head1 AUTHOR
49
50Chris Laco <claco@chrislaco.com>
51
52=head1 LICENSE
53
54You may distribute this code under the same terms as Perl itself.