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