Element/RadioTarget.pm

filter: Statementstmt 88.4% 23 / 26 Branchbran 100% 2 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod 66.6% 2 / 3 totaltotal 80.0% 32 / 40 SCAR 11.1
CC
3
Cov
87%
BUILD
3.0
as_string
2.0
as_text
2.0
CRAP 3.0
« Element/Footnote.pm ↑ Summary Element/ListItem.pm »
1 package Org::Element::RadioTarget;
2  
3 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use locale;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 extends 'Org::Element';
7 4 with 'Org::ElementRole';
8 4 with 'Org::ElementRole::Inline';
9  
10 4 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 4 our $DATE = '2023-08-05'; # DATE
12 4 our $DIST = 'Org-Parser'; # DIST
13 4 our $VERSION = '0.560'; # VERSION
14  
15 4 has target => (is => 'rw');
16  
17 sub BUILD {
18 4 ▶ my ($self, $args) = @_;
Subroutine BUILD: called CC=3 SCAR=11.0
Pod undocumented
19 4 ▶ my $pass = $args->{pass} // 1;
Condition50%1/2
$args->{"pass"} // 1
l!l
40
MC/DC0%0/1
$args->{"pass"} // 1
$args->{"pass"}
Truth table50%1/2
A
A= $args->{"pass"}
Aresult
11
00
20 4 my $doc = $self->document;
21 4 ▶ if ($pass == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pass == 1) 2 2 4
22 2 push @{ $doc->radio_targets },
23 $self->target;
24 }
25 }
26  
27 sub as_string {
28 0 ▶ my ($self) = @_;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
29 0 join("",
30 "<<<", $self->target, ">>>");
31 }
32  
33 sub as_text {
34 0 ▶ goto \&as_string;
Subroutine as_text: not called CC=1 SCAR=6.9
Pod documented
35 }
36  
37 4 1;
38 # ABSTRACT: Represent Org radio target
39  
40 __END__
41  
42 =pod
43  
44 =encoding UTF-8
45  
46 =head1 NAME
47  
48 Org::Element::RadioTarget - Represent Org radio target
49  
50 =head1 VERSION
51  
52 This document describes version 0.560 of Org::Element::RadioTarget (from Perl distribution Org-Parser), released on 2023-08-05.
53  
54 =head1 DESCRIPTION
55  
56 Derived from L<Org::Element>.
57  
58 =for Pod::Coverage ^(BUILD)$
59  
60 =head1 ATTRIBUTES
61  
62 =head2 target
63  
64 =head1 METHODS
65  
66 =head2 as_string => str
67  
68 From L<Org::Element>.
69  
70 =head2 as_text => str
71  
72 From L<Org::ElementRole::Inline>.
73  
74 =head1 HOMEPAGE
75  
76 Please visit the project's homepage at L<https://metacpan.org/release/Org-Parser>.
77  
78 =head1 SOURCE
79  
80 Source repository is at L<https://github.com/perlancar/perl-Org-Parser>.
81  
82 =head1 AUTHOR
83  
84 perlancar <perlancar@cpan.org>
85  
86 =head1 CONTRIBUTING
87  
88  
89 To contribute, you can send patches by email/via RT, or send pull requests on
90 GitHub.
91  
92 Most of the time, you don't need to build the distribution yourself. You can
93 simply modify the code, then test via:
94  
95 % prove -l
96  
97 If you want to build the distribution (e.g. to try to install it locally on your
98 system), you can install L<Dist::Zilla>,
99 L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
100 L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
101 Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
102 that are considered a bug and can be reported to me.
103  
104 =head1 COPYRIGHT AND LICENSE
105  
106 This software is copyright (c) 2023, 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
107  
108 This is free software; you can redistribute it and/or modify it under
109 the same terms as the Perl 5 programming language system itself.
110  
111 =head1 BUGS
112  
113 Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
114  
115 When submitting a bug or request, please include a test-file or a
116 patch to an existing test-file that illustrates the bug or desired
117 feature.
118  
119 =cut
« Element/Footnote.pm ↑ Summary Element/ListItem.pm »