Element/Text.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond 50.0% 6 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 76.4% 39 / 51 CC 7 SCAR 12.8
CC
7
Cov
84%
as_string
4.6
as_text
4.6
BEGIN
1.0
CRAP 3.6
« Element.pm ↑ Summary Element/Drawer.pm »
1 package Org::Element::Text;
2  
3 25 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use locale;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 25 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 25 extends 'Org::Element';
7 25 with 'Org::ElementRole';
8 25 with 'Org::ElementRole::Inline';
9  
10 25 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 25 our $DATE = '2026-07-21'; # DATE
12 25 our $DIST = 'Org-Parser'; # DIST
13 25 our $VERSION = '0.563'; # VERSION
14  
15 25 has text => (is => 'rw');
16 25 has style => (is => 'rw');
17  
18 25 our %mu2style = (''=>'', '*'=>'B', '_'=>'U', '/'=>'I',
19 '+'=>'S', '='=>'C', '~'=>'V');
20 25 our %style2mu = reverse(%mu2style);
21  
22 194 ▶sub as_string {
Subroutine as_string: called CC=4 SCAR=15.2
Pod documented
23 194 my ($self) = @_;
24 194 ▶ my $muchar = $style2mu{$self->style // ''} // '';
Condition50%2/4
$Org::Element::Text::style2mu{$self->style // ""} // ""
l!l
1940
$self->style // ""
l!l
1940
MC/DC0%0/1
$Org::Element::Text::style2mu{$self->style // ""} // ""
$Org::Element::Text::style2mu{$self->style // ""}
MC/DC0%0/1
$self->style // ""
$self->style
Truth table50%1/2
A
A= $Org::Element::Text::style2mu{$self->style // ""}
Aresult
11
00
Truth table50%1/2
A
A= $self->style
Aresult
11
00
25  
26 194 ▶ join("",
Condition50%1/2
$self->text // ""
l!l
1940
MC/DC0%0/1
$self->text // ""
$self->text
Truth table50%1/2
A
A= $self->text
Aresult
11
00
27 $muchar,
28 $self->text // '', $self->children_as_string,
29 $muchar);
30 }
31  
32 1 ▶sub as_text {
Subroutine as_text: called CC=4 SCAR=15.2
Pod documented
33 1 my $self = shift;
34 1 ▶ my $muchar = $style2mu{$self->style // ''} // '';
Condition50%2/4
$Org::Element::Text::style2mu{$self->style // ""} // ""
l!l
10
$self->style // ""
l!l
10
MC/DC0%0/1
$Org::Element::Text::style2mu{$self->style // ""} // ""
$Org::Element::Text::style2mu{$self->style // ""}
MC/DC0%0/1
$self->style // ""
$self->style
Truth table50%1/2
A
A= $Org::Element::Text::style2mu{$self->style // ""}
Aresult
11
00
Truth table50%1/2
A
A= $self->style
Aresult
11
00
35  
36 1 ▶ join("",
Condition50%1/2
$self->text // ""
l!l
10
MC/DC0%0/1
$self->text // ""
$self->text
Truth table50%1/2
A
A= $self->text
Aresult
11
00
37 $muchar,
38 $self->text // '', $self->children_as_text,
39 $muchar);
40 }
41  
42 25 1;
43 # ABSTRACT: Represent text
44  
45 __END__
« Element.pm ↑ Summary Element/Drawer.pm »