Minimal.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 100% 20 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Perfect.pm ↑ Summary
1 package BRIANG::Dist::Minimal;
2  
3 1 ▶use 5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 BRIANG::Dist::Minimal - A minimal implementation.
11  
12 =head1 VERSION
13  
14 This is
15 version 0.0101
16 released 2020-11-21
17  
18 =cut
19  
20 1 our $VERSION = '0.0101';
21  
22 =head1 SYNOPSIS
23  
24 use BRIANG::Dist::Minimal;
25  
26 my $BDM = BRIANG::Dist::Minimal->new(7);
27 say $BDM->value(); # 3.5
28  
29 =head1 DESCRIPTION
30  
31 This module is a component from the C<BRIANG::Dist::Perfect>
32 distribution.
33  
34 This module uses an object-oriented approach to half numbers.
35  
36 =head1 CONSTRUCTOR
37  
38 =head2 new
39  
40 $object = BRIANG::Dist::Minimal->new($value)
41  
42 Initialises a new C<BRIANG::Dist::Minimal> object, and returns
43 it. C<$value> sets the number to be halved.
44  
45 =cut
46  
47 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
48 1 my ($class, $initial) = @_;
49 1 return bless {value => $initial / 2}, $class;
50 }
51  
52 =head1 METHODS
53  
54 =head2 value
55  
56 $halved_value = $BDM->value();
57  
58 C<value()> returns the halved value.
59  
60 =cut
61  
62 1 ▶sub value { shift->{value} }
Subroutine value: called CC=1 SCAR=0.0
Pod documented
63  
64 =head1 AUTHOR, COPYRIGHT AND LICENSE
65  
66 Copyright 2020 Brian Greenfield <briang at cpan dot org>
67  
68 This is free software. You can use, redistribute, and/or modify it
69 under the terms laid out in the L<MIT licence|LICENCE>.
70  
71 =head1 CODE REPOSITORY AND ISSUE REPORTING
72  
73 This project's source code is
74 L<hosted|https://github.com/briang/p5-briang-dist-perfect> on
75 L<GitHub.com|http://github.com>.
76  
77 Issues should be reported using the project's GitHub L<issue
78 tracker|https://github.com/briang/p5-briang-dist-perfect/issues>.
79  
80 Contributions are welcome. Please use L<GitHub Pull
81 Requests|https://github.com/briang/p5-briang-dist-perfect/pulls>.
82  
83 =cut
84  
85 1 1;
« Perfect.pm ↑ Summary