File Coverage

blib/lib/FTN/Message/serialno.pm
Criterion Covered Total %
statement 11 13 84.6
branch 1 4 25.0
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 18 24 75.0


line stmt bran cond sub pod time code
1             package FTN::Message::serialno;
2              
3 2     2   16672 use strict;
  2         2  
  2         70  
4 2     2   8 use warnings FATAL => 'all';
  2         3  
  2         61  
5              
6 2     2   8 use Carp ();
  2         5  
  2         206  
7              
8             =encoding utf8
9              
10             =head1 NAME
11              
12             FTN::Message::serialno - base class for dealing with FTN message serialno.
13              
14             =head1 VERSION
15              
16             Version 20141120
17              
18             =cut
19              
20             our $VERSION = '20141120';
21              
22             =head1 SYNOPSIS
23              
24             use parent 'FTN::Message::serialno';
25              
26             # define real methods here
27              
28             =head1 DESCRIPTION
29              
30             This is a base class for handling serialno value for new FTN messages. Defines two virtual methods which should be defined in subclasses that use different approaches to manage required uniqueness (file on the disk, auto_increment field in table in database for example).
31              
32             =over
33              
34             =item * new
35              
36             Class constructor.
37              
38             =cut
39              
40             sub new {
41 3 50   3 1 12 ref( my $class = shift ) and Carp::croak 'I am only a class method!';
42              
43 3         10 bless {}, $class;
44             }
45              
46             =item * get_serialno
47              
48             Returns serialno field value for new FTN message.
49              
50             =back
51              
52             =cut
53              
54             sub get_serialno {
55 0 0   0 1   ref( my $self = shift ) or Carp::croak 'I am only an object method!';
56              
57 0           undef; # virtual method!
58             }
59              
60             =head1 AUTHOR
61              
62             Valery Kalesnik, C<< >>
63              
64             =head1 BUGS
65              
66             Please report any bugs or feature requests to C, or through
67             the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
68              
69             =head1 SUPPORT
70              
71             You can find documentation for this module with the perldoc command.
72              
73             perldoc FTN::Message::serialno
74              
75              
76             You can also look for information at:
77              
78             =over 4
79              
80             =item * RT: CPAN's request tracker (report bugs here)
81              
82             L
83              
84             =item * AnnoCPAN: Annotated CPAN documentation
85              
86             L
87              
88             =item * CPAN Ratings
89              
90             L
91              
92             =item * Search CPAN
93              
94             L
95              
96             =back
97              
98              
99             =head1 ACKNOWLEDGEMENTS
100              
101              
102             =head1 LICENSE AND COPYRIGHT
103              
104             Copyright 2014 Valery Kalesnik.
105              
106             This program is free software; you can redistribute it and/or modify it
107             under the terms of the the Artistic License (2.0). You may obtain a
108             copy of the full license at:
109              
110             L
111              
112             Any use, modification, and distribution of the Standard or Modified
113             Versions is governed by this Artistic License. By using, modifying or
114             distributing the Package, you accept this license. Do not use, modify,
115             or distribute the Package, if you do not accept this license.
116              
117             If your Modified Version has been derived from a Modified Version made
118             by someone other than you, you are nevertheless required to ensure that
119             your Modified Version complies with the requirements of this license.
120              
121             This license does not grant you the right to use any trademark, service
122             mark, tradename, or logo of the Copyright Holder.
123              
124             This license includes the non-exclusive, worldwide, free-of-charge
125             patent license to make, have made, use, offer to sell, sell, import and
126             otherwise transfer the Package with respect to any patent claims
127             licensable by the Copyright Holder that are necessarily infringed by the
128             Package. If you institute patent litigation (including a cross-claim or
129             counterclaim) against any party alleging that the Package constitutes
130             direct or contributory patent infringement, then this Artistic License
131             to you shall terminate on the date that such litigation is filed.
132              
133             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
134             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
135             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
136             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
137             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
138             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
139             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
140             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
141              
142             =cut
143              
144             1;