Commit | Line | Data |
947acfd9 |
1 | package DBIx::Class::UUIDMaker::APR::UUID; |
bf5ecff9 |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
947acfd9 |
6 | use base qw/DBIx::Class::UUIDMaker/; |
7 | use APR::UUID (); |
8 | |
9 | sub as_string { |
10 | return APR::UUID->new->format; |
11 | }; |
12 | |
13 | 1; |
e78f023a |
14 | __END__ |
15 | |
16 | =head1 NAME |
17 | |
18 | DBIx::Class::UUIDMaker::APR::UUID - Create uuids using APR::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('::APR::UUID'); |
26 | |
27 | =head1 DESCRIPTION |
28 | |
29 | This DBIx::Class::UUIDMaker subclass uses APR::UUID to generate uuid |
30 | strings in the following format: |
31 | |
32 | 098f2470-bae0-11cd-b579-08002b30bfeb |
33 | |
34 | =head1 METHODS |
35 | |
36 | =head2 as_string |
37 | |
38 | Returns the new uuid as a string. |
39 | |
40 | =head1 SEE ALSO |
41 | |
42 | L<APR::UUID> |
43 | |
44 | =head1 AUTHOR |
45 | |
46 | Chris Laco <claco@chrislaco.com> |
47 | |
48 | =head1 LICENSE |
49 | |
50 | You may distribute this code under the same terms as Perl itself. |