File Coverage

blib/lib/Org/Element/Footnote.pm
Criterion Covered Total %
statement 13 16 81.2
branch 0 2 0.0
condition 0 2 0.0
subroutine 5 7 71.4
pod 2 3 66.6
total 20 30 66.6


line stmt bran cond sub pod time code
1             package Org::Element::Footnote;
2              
3 3     3   1078 use 5.010;
  3         11  
4 3     3   16 use locale;
  3         6  
  3         15  
5 3     3   116 use Log::ger;
  3         5  
  3         22  
6 3     3   727 use Moo;
  3         6  
  3         17  
7             extends 'Org::Element';
8             with 'Org::ElementRole';
9             with 'Org::ElementRole::Inline';
10              
11             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
12             our $DATE = '2023-08-05'; # DATE
13             our $DIST = 'Org-Parser'; # DIST
14             our $VERSION = '0.560'; # VERSION
15              
16             has name => (is => 'rw');
17             has is_ref => (is => 'rw');
18             has def => (is => 'rw');
19              
20             sub BUILD {
21 5     5 0 1712 my ($self, $args) = @_;
22 5         17 log_trace("name = %s", $self->name);
23             }
24              
25             sub as_string {
26 0     0 1   my ($self) = @_;
27              
28 0 0 0       join("",
29             "[fn:", ($self->name // ""),
30             defined($self->def) ? ":".$self->def->as_string : "",
31             "]");
32             }
33              
34             sub as_text {
35 0     0 1   goto \&as_string;
36             }
37              
38             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