Articulate/Sortation/Numeric.pm

filter: Statementstmt 84.6% 11 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 83.3% 15 / 18 CC 1 SCAR 2.2
CC
1
Cov
85%
cmp
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Articulate/Serialisation/TemplateToolkit.pm ↑ Summary Articulate/Enrichment/DateCreated.pm »
1 package Articulate::Sortation::Numeric;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 with 'Articulate::Role::Sortation::AllYouNeedIsCmp';
7  
8 =head1 NAME
9  
10 Articulate::Sortation::Numeric - sort strings using the spaceship
11 operator
12  
13 =head1 DESCRIPTION
14  
15 This implements the L<Articulate::Role::Sortation::AllYouNeedIsCmp>
16 role to provide a very basic numerical sorter object.
17  
18 =head1 METHODS
19  
20 One method provided here, the rest are as in
21 L<Articulate::Role::Sortation::AllYouNeedIsCmp>.
22  
23 =head3 cmp
24  
25 $self->cmp($a, $b); # returns $a <=> $b
26  
27 =cut
28  
29 0 ▶sub cmp {
Subroutine cmp: not called CC=1 SCAR=6.9
Pod documented
30 0 my $self = shift;
31 0 return ( $_[0] <=> $_[1] );
32 }
33  
34 =head1 SEE ALSO
35  
36 =over
37  
38 =item * L<Articulate::Sortation::String>
39  
40 =item * L<Articulate::Sortation::Slug>
41  
42 =back
43  
44 =cut
45  
46 1 1;
« Articulate/Serialisation/TemplateToolkit.pm ↑ Summary Articulate/Enrichment/DateCreated.pm »