blib/lib/Venus/False.pm

filter: Statementstmt 95.0% 19 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 2 / 2 totaltotal 93.5% 29 / 31 CC 1 SCAR 1.1
CC
1
Cov
95%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Venus/Core/Class.pm ↑ Summary blib/lib/Venus/True.pm »
1 package Venus::False;
2  
3 120 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 120 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 120 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # IMPORTS
9  
10 120 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # STATE
13  
14 120 state $false = Scalar::Util::dualvar(0, "0");
15  
16 # OVERLOADS
17  
18 120 ▶use overload (
Subroutine BEGIN: called CC=1 SCAR=0.1
19 3 ▶ '!' => sub{!$false},
Subroutine __ANON__: called CC=1 SCAR=0.0
20 0 ▶ 'bool' => sub{$false},
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 120 fallback => 1,
22 120 );
23  
24 # METHODS
25  
26 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
27 3 return bless({});
28 }
29  
30 12720 ▶sub value {
Subroutine value: called CC=1 SCAR=0.0
Pod documented
31 12720 return $false;
32 }
33  
34 120 1;
35  
36  
37  
38 =head1 NAME
39  
40 Venus::False - False Class
41  
42 =cut
43  
44 =head1 ABSTRACT
45  
46 False Class for Perl 5
47  
48 =cut
49  
50 =head1 SYNOPSIS
51  
52 package main;
53  
54 use Venus::False;
55  
56 my $false = Venus::False->new;
57  
58 # $false->value;
59  
60 =cut
61  
62 =head1 DESCRIPTION
63  
64 This package provides the global C<false> value used in L<Venus::Boolean> and
65 the L<Venus/false> function.
66  
67 =cut
68  
69 =head1 METHODS
70  
71 This package provides the following methods:
72  
73 =cut
74  
75 =head2 new
76  
77 new() (Venus::False)
78  
79 The new method constructs an instance of the package.
80  
81 I<Since C<4.15>>
82  
83 =over 4
84  
85 =item new example 1
86  
87 package main;
88  
89 use Venus::False;
90  
91 my $new = Venus::False->new;
92  
93 # bless(..., "Venus::False")
94  
95 =back
96  
97 =cut
98  
99 =head2 value
100  
101 value() (boolean)
102  
103 The value method returns value representing the global C<false> value.
104  
105 I<Since C<1.23>>
106  
107 =over 4
108  
109 =item value example 1
110  
111 # given: synopsis;
112  
113 my $value = $false->value;
114  
115 # 0
116  
117 =back
118  
119 =cut
120  
121 =head1 AUTHORS
122  
123 Awncorp, C<awncorp@cpan.org>
124  
125 =cut
126  
127 =head1 LICENSE
128  
129 Copyright (C) 2022, Awncorp, C<awncorp@cpan.org>.
130  
131 This program is free software, you can redistribute it and/or modify it under
132 the terms of the Apache license version 2.0.
133  
134 =cut
« blib/lib/Venus/Core/Class.pm ↑ Summary blib/lib/Venus/True.pm »