Element/Link.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 93.0% 40 / 43 CC 5 SCAR 9.6
CC
5
Cov
94%
as_string
4.1
as_text
2.0
BEGIN
1.0
CRAP 2.6
« Element/Drawer.pm ↑ Summary Element/TableRow.pm »
1 package Org::Element::Link;
2  
3 6 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use locale;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 extends 'Org::Element';
7 6 with 'Org::ElementRole';
8 6 with 'Org::ElementRole::Inline';
9  
10 6 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 6 our $DATE = '2023-11-06'; # DATE
12 6 our $DIST = 'Org-Parser'; # DIST
13 6 our $VERSION = '0.561'; # VERSION
14  
15 6 has link => (is => 'rw');
16 6 has description => (is => 'rw');
17 6 has from_radio_target => (is => 'rw');
18  
19 sub as_string {
20 2 ▶ my ($self) = @_;
Subroutine as_string: called CC=4 SCAR=14.2
Pod documented
21 2 ▶ return $self->_str if defined $self->_str;
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->_str 0 2 2
22 2 ▶ join("",
Branch: 1 branch
BranchTrueFalseTotal
defined $self->description && length $self->description ? : 1 1 2
Condition66%2/3
defined $self->description and length $self->description
!ll&&!rl&&r
101
MC/DC50%1/2
defined $self->description and length $self->description
defined $self->description length $self->description
Truth table66%2/3
A and B
A= defined $self->descriptionB= length $self->description
ABresult
0X0
100
111
23 "[",
24 "[", $self->link, "]",
25 (defined($self->description) && length($self->description) ?
26 ("[", $self->description->as_string, "]") : ()),
27 "]");
28 }
29  
30 sub as_text {
31 2 ▶ my $self = shift;
Subroutine as_text: called CC=2 SCAR=6.9
Pod documented
32 2 my $desc = $self->description;
33 2 ▶ defined($desc) ? $desc->as_text : $self->link;
Branch: 1 branch
BranchTrueFalseTotal
defined $desc ? : 1 1 2
34 }
35  
36 6 1;
37 # ABSTRACT: Represent Org hyperlink
38  
39 __END__
40  
41 =pod
42  
43 =encoding UTF-8
44  
45 =head1 NAME
46  
47 Org::Element::Link - Represent Org hyperlink
48  
49 =head1 VERSION
50  
51 This document describes version 0.561 of Org::Element::Link (from Perl distribution Org-Parser), released on 2023-11-06.
52  
53 =head1 DESCRIPTION
54  
55 Derived from L<Org::Element>.
56  
57 =head1 ATTRIBUTES
58  
59 =head2 link => STR
60  
61 =head2 description => OBJ
62  
63 =head2 from_radio_target => BOOL
64  
65 =head1 METHODS
66  
67 =head2 as_string => str
68  
69 From L<Org::Element>.
70  
71 =head2 as_text => str
72  
73 From L<Org::ElementRole::Inline>.
74  
75 =head1 HOMEPAGE
76  
77 Please visit the project's homepage at L<https://metacpan.org/release/Org-Parser>.
78  
79 =head1 SOURCE
80  
81 Source repository is at L<https://github.com/perlancar/perl-Org-Parser>.
82  
83 =head1 AUTHOR
84  
85 perlancar <perlancar@cpan.org>
86  
87 =head1 CONTRIBUTING
88  
89  
90 To contribute, you can send patches by email/via RT, or send pull requests on
91 GitHub.
92  
93 Most of the time, you don't need to build the distribution yourself. You can
94 simply modify the code, then test via:
95  
96 % prove -l
97  
98 If you want to build the distribution (e.g. to try to install it locally on your
99 system), you can install L<Dist::Zilla>,
100 L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
101 L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
102 Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
103 that are considered a bug and can be reported to me.
104  
105 =head1 COPYRIGHT AND LICENSE
106  
107 This software is copyright (c) 2023, 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
108  
109 This is free software; you can redistribute it and/or modify it under
110 the same terms as the Perl 5 programming language system itself.
111  
112 =head1 BUGS
113  
114 Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
115  
116 When submitting a bug or request, please include a test-file or a
117 patch to an existing test-file that illustrates the bug or desired
118 feature.
119  
120 =cut
« Element/Drawer.pm ↑ Summary Element/TableRow.pm »