Element/Footnote.pm

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