finishing off UUIDColumns move
[dbsrgits/DBIx-Class-UUIDColumns.git] / lib / DBIx / Class / UUIDColumns / UUIDMaker / UUID.pm
1 package DBIx::Class::UUIDMaker::UUID;
2
3 use strict;
4 use warnings;
5
6 use base qw/DBIx::Class::UUIDMaker/;
7 use UUID ();
8
9 sub as_string {
10     my ($uuid, $uuidstring);
11     UUID::generate($uuid);
12     UUID::unparse($uuid, $uuidstring);
13
14     return $uuidstring;
15 };
16
17 1;
18 __END__
19
20 =head1 NAME
21
22 DBIx::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
33 This DBIx::Class::UUIDMaker subclass uses UUID to generate uuid
34 strings in the following format:
35
36   098f2470-bae0-11cd-b579-08002b30bfeb
37
38 =head1 METHODS
39
40 =head2 as_string
41
42 Returns the new uuid as a string.
43
44 =head1 SEE ALSO
45
46 L<UUID>
47
48 =head1 AUTHOR
49
50 Chris Laco <claco@chrislaco.com>
51
52 =head1 LICENSE
53
54 You may distribute this code under the same terms as Perl itself.