File Coverage

lib/Workflow/Persister/UUID.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 3 3 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1              
2             use warnings;
3 1     1   2774 use strict;
  1         2  
  1         39  
4 1     1   5 use Data::UUID;
  1         2  
  1         18  
5 1     1   4  
  1         1  
  1         180  
6             $Workflow::Persister::UUID::VERSION = '1.61';
7              
8             my ( $class, $params ) = @_;
9             my $self = bless { gen => Data::UUID->new() }, $class;
10 1     1 1 537 return $self;
11 1         2340 }
12 1         7  
13             my ( $self, $dbh ) = @_;
14             return $self->{gen}->create_str();
15             }
16 2     2 1 2301  
17 2         102  
18             1;
19              
20 1     1 1 368  
21             =pod
22              
23             =head1 NAME
24              
25             Workflow::Persister::UUID - Persister to generate Universally Unique Identifiers
26              
27             =head1 VERSION
28              
29             This documentation describes version 1.61 of this package
30              
31             =head1 SYNOPSIS
32              
33             <persister
34             name="MyPersister"
35             use_uuid="yes"
36             ...
37              
38             =head1 DESCRIPTION
39              
40             Implementation for any persister to generate a UUID/GUID ID
41             string. The resulting string is 36 characters long and, according to
42             the implementation docs, "is guaranteed to be different from all other
43             UUIDs/GUIDs generated until 3400 CE."
44              
45             This uses the L<Data::UUID> module to generate the UUID string, so
46             look there if you are curious about the algorithm, efficiency, etc.
47              
48             =head2 METHODS
49              
50             =head3 new
51              
52             Instantiates a Workflow::Persister::UUID object, which is actually an
53             encapsulation of L<Data::UUID>.
54              
55             =head3 pre_fetch_id
56              
57             L</pre_fetch_id> can then be used to generate/retrieve a unique ID, generated
58             by L<Data::UUID>.
59              
60             =head3 post_fetch_id
61              
62             This method is unimplemented at this time, please see the TODO.
63              
64             =head1 TODO
65              
66             =over
67              
68             =item * Implement L</post_fetch_id>
69              
70             =back
71              
72             =head1 SEE ALSO
73              
74             =over
75              
76             =item L<Data::UUID>
77              
78             =back
79              
80             =head1 COPYRIGHT
81              
82             Copyright (c) 2003-2022 Chris Winters. All rights reserved.
83              
84             This library is free software; you can redistribute it and/or modify
85             it under the same terms as Perl itself.
86              
87             Please see the F<LICENSE>
88              
89             =head1 AUTHORS
90              
91             Please see L<Workflow>
92              
93             =cut