Commit | Line | Data |
947acfd9 |
1 | package DBIx::Class::UUIDMaker::Win32::Guidgen; |
bf5ecff9 |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
947acfd9 |
6 | use base qw/DBIx::Class::UUIDMaker/; |
7 | use Win32::Guidgen (); |
8 | |
9 | sub as_string { |
10 | my $uuid = Win32::Guidgen::create(); |
e78f023a |
11 | $uuid =~ s/(^\{|\}$)//g; |
947acfd9 |
12 | |
13 | return $uuid; |
14 | }; |
15 | |
16 | 1; |
e78f023a |
17 | __END__ |
18 | |
19 | =head1 NAME |
20 | |
04863f36 |
21 | DBIx::Class::UUIDMaker::Win32::Guidgen - Create uuids using Win32::Guidgen |
e78f023a |
22 | |
23 | =head1 SYNOPSIS |
24 | |
25 | package Artist; |
26 | __PACKAGE__->load_components(qw/UUIDColumns Core DB/); |
27 | __PACKAGE__->uuid_columns( 'artist_id' ); |
28 | __PACKAGE__->uuid_class('::Win32::Guidgen'); |
29 | |
30 | =head1 DESCRIPTION |
31 | |
32 | This DBIx::Class::UUIDMaker subclass uses Win32::Guidgen to generate uuid |
33 | strings in the following format: |
34 | |
35 | 098f2470-bae0-11cd-b579-08002b30bfeb |
36 | |
37 | =head1 METHODS |
38 | |
39 | =head2 as_string |
40 | |
41 | Returns the new uuid as a string. |
42 | |
43 | =head1 SEE ALSO |
44 | |
45 | L<Win32::Guidgen> |
46 | |
47 | =head1 AUTHOR |
48 | |
49 | Chris Laco <claco@chrislaco.com> |
50 | |
51 | =head1 LICENSE |
52 | |
53 | You may distribute this code under the same terms as Perl itself. |