File Coverage

blib/lib/Org/Element/ListItem.pm
Criterion Covered Total %
statement 12 12 100.0
branch 3 4 75.0
condition n/a
subroutine 5 5 100.0
pod 1 2 50.0
total 21 23 91.3


line stmt bran cond sub pod time code
1             package Org::Element::ListItem;
2              
3 6     6   1141 use 5.010;
  6         24  
4 6     6   38 use locale;
  6         13  
  6         38  
5 6     6   196 use Moo;
  6         11  
  6         26  
6             extends 'Org::Element';
7              
8             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
9             our $DATE = '2023-08-05'; # DATE
10             our $DIST = 'Org-Parser'; # DIST
11             our $VERSION = '0.560'; # VERSION
12              
13             has bullet => (is => 'rw');
14             has check_state => (is => 'rw');
15             has desc_term => (is => 'rw');
16              
17             sub header_as_string {
18 3     3 0 3535 my ($self) = @_;
19 3 50       38 join("",
    100          
20             $self->parent->indent,
21             $self->bullet, " ",
22             defined($self->check_state) ? "[".$self->check_state."]" : "",
23             defined($self->desc_term) ? $self->desc_term->as_string . " ::" : "",
24             );
25             }
26              
27             sub as_string {
28 2     2 1 5 my ($self) = @_;
29 2         6 $self->header_as_string . $self->children_as_string;
30             }
31              
32             1;
33             # ABSTRACT: Represent Org list item
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Org::Element::ListItem - Represent Org list item
44              
45             =head1 VERSION
46              
47             This document describes version 0.560 of Org::Element::ListItem (from Perl distribution Org-Parser), released on 2023-08-05.
48              
49             =head1 DESCRIPTION
50              
51             Must have L<Org::Element::List> as parent.
52              
53             Derived from L<Org::Element>.
54              
55             =head1 ATTRIBUTES
56              
57             =head2 bullet
58              
59             =head2 check_state
60              
61             undef, " ", "X" or "-".
62              
63             =head2 desc_term
64              
65             Description term (for description list).
66              
67             =head1 METHODS
68              
69             =for Pod::Coverage header_as_string as_string
70              
71             =head1 HOMEPAGE
72              
73             Please visit the project's homepage at L<https://metacpan.org/release/Org-Parser>.
74              
75             =head1 SOURCE
76              
77             Source repository is at L<https://github.com/perlancar/perl-Org-Parser>.
78              
79             =head1 AUTHOR
80              
81             perlancar <perlancar@cpan.org>
82              
83             =head1 CONTRIBUTING
84              
85              
86             To contribute, you can send patches by email/via RT, or send pull requests on
87             GitHub.
88              
89             Most of the time, you don't need to build the distribution yourself. You can
90             simply modify the code, then test via:
91              
92             % prove -l
93              
94             If you want to build the distribution (e.g. to try to install it locally on your
95             system), you can install L<Dist::Zilla>,
96             L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
97             L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
98             Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
99             that are considered a bug and can be reported to me.
100              
101             =head1 COPYRIGHT AND LICENSE
102              
103             This software is copyright (c) 2023, 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
104              
105             This is free software; you can redistribute it and/or modify it under
106             the same terms as the Perl 5 programming language system itself.
107              
108             =head1 BUGS
109              
110             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
111              
112             When submitting a bug or request, please include a test-file or a
113             patch to an existing test-file that illustrates the bug or desired
114             feature.
115              
116             =cut