ElementRole/Inline.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 3 / 3 totaltotal 71.4% 20 / 28 SCAR 7.5
CC
2
Cov
70%
children_as_text
2.7
is_block
2.0
is_inline
2.0
CRAP 2.1
« Element/ListItem.pm ↑ Summary Element/TableHLine.pm »
1 package Org::ElementRole::Inline;
2  
3 32 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 32 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 32 requires 'as_text';
7  
8 32 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
9 32 our $DATE = '2023-08-05'; # DATE
10 32 our $DIST = 'Org-Parser'; # DIST
11 32 our $VERSION = '0.560'; # VERSION
12  
13 0 ▶sub is_block { 0 }
Subroutine is_block: not called CC=1 SCAR=6.9
Pod documented
14  
15 0 ▶sub is_inline { 1 }
Subroutine is_inline: not called CC=1 SCAR=6.9
Pod documented
16  
17 sub children_as_text {
18 1 ▶ my ($self) = @_;
Subroutine children_as_text: called CC=2 SCAR=10.1
Pod documented
19 1 ▶ return "" unless $self->children;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->children 1 0 1
20 0 join "", map {$_->as_text} @{$self->children};
21 }
22  
23 32 1;
24 # ABSTRACT: Role for inline elements
25  
26 __END__
27  
28 =pod
29  
30 =encoding UTF-8
31  
32 =head1 NAME
33  
34 Org::ElementRole::Inline - Role for inline elements
35  
36 =head1 VERSION
37  
38 This document describes version 0.560 of Org::ElementRole::Inline (from Perl distribution Org-Parser), released on 2023-08-05.
39  
40 =head1 DESCRIPTION
41  
42 This role is applied to elements that are "inline": elements that can occur
43 inside text and put as a child of L<Org::Element::Text>.
44  
45 =head1 REQUIRES
46  
47 =head2 as_text => str
48  
49 Get the "rendered plaintext" representation of element. Most elements would
50 return the same result as C<as_string>, except for elements like
51 L<Org::Element::Link> which will return link description instead of the link
52 itself.
53  
54 =head1 METHODS
55  
56 =head2 is_block => bool (0)
57  
58 =head2 is_inline => bool (1)
59  
60 =head2 children_as_text => str
61  
62 =head1 HOMEPAGE
63  
64 Please visit the project's homepage at L<https://metacpan.org/release/Org-Parser>.
65  
66 =head1 SOURCE
67  
68 Source repository is at L<https://github.com/perlancar/perl-Org-Parser>.
69  
70 =head1 AUTHOR
71  
72 perlancar <perlancar@cpan.org>
73  
74 =head1 CONTRIBUTING
75  
76  
77 To contribute, you can send patches by email/via RT, or send pull requests on
78 GitHub.
79  
80 Most of the time, you don't need to build the distribution yourself. You can
81 simply modify the code, then test via:
82  
83 % prove -l
84  
85 If you want to build the distribution (e.g. to try to install it locally on your
86 system), you can install L<Dist::Zilla>,
87 L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
88 L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
89 Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
90 that are considered a bug and can be reported to me.
91  
92 =head1 COPYRIGHT AND LICENSE
93  
94 This software is copyright (c) 2023, 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
95  
96 This is free software; you can redistribute it and/or modify it under
97 the same terms as the Perl 5 programming language system itself.
98  
99 =head1 BUGS
100  
101 Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
102  
103 When submitting a bug or request, please include a test-file or a
104 patch to an existing test-file that illustrates the bug or desired
105 feature.
106  
107 =cut
« Element/ListItem.pm ↑ Summary Element/TableHLine.pm »