blib/lib/FTN/Message/serialno.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 76.9% 20 / 26 SCAR 11.5
CC
3
Cov
74%
get_serialno
6.0
new
2.1
BEGIN
1.0
CRAP 3.2
« Build ↑ Summary
1 package FTN::Message::serialno;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
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 3 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 1 ▶ ref( my $class = shift ) and Carp::croak 'I am only a class method!';
Subroutine new: called CC=2 SCAR=7.2
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
ref(my $class = shift()) and Carp::croak("I am only a class method!") 0 1 1
42  
43 1 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 ▶ ref( my $self = shift ) or Carp::croak 'I am only an object method!';
Subroutine get_serialno: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
ref(my $self = shift()) or Carp::croak("I am only an object method!") 0 0 0
56  
57 0 undef; # virtual method!
58 }
59  
60 =head1 AUTHOR
61  
62 Valery Kalesnik, C<< <valkoles at gmail.com> >>
63  
64 =head1 BUGS
65  
66 Please report any bugs or feature requests to C<bug-ftn-message-serialno at rt.cpan.org>, or through
67 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FTN-Message-serialno>. 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<http://rt.cpan.org/NoAuth/Bugs.html?Dist=FTN-Message-serialno>
83  
84 =item * AnnoCPAN: Annotated CPAN documentation
85  
86 L<http://annocpan.org/dist/FTN-Message-serialno>
87  
88 =item * CPAN Ratings
89  
90 L<http://cpanratings.perl.org/d/FTN-Message-serialno>
91  
92 =item * Search CPAN
93  
94 L<http://search.cpan.org/dist/FTN-Message-serialno/>
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<http://www.perlfoundation.org/artistic_license_2_0>
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 3 1;
« Build ↑ Summary