File Coverage

blib/lib/Org/Element/Link.pm
Criterion Covered Total %
statement 14 14 100.0
branch 5 6 83.3
condition 2 3 66.6
subroutine 5 5 100.0
pod 2 2 100.0
total 28 30 93.3


line stmt bran cond sub pod time code
1              
2             use 5.010;
3 5     5   1222 use locale;
  5         17  
4 5     5   21 use Moo;
  5         10  
  5         25  
5 5     5   132 extends 'Org::Element';
  5         7  
  5         22  
6             with 'Org::ElementRole';
7             with 'Org::ElementRole::Inline';
8              
9             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
10             our $DATE = '2022-06-23'; # DATE
11             our $DIST = 'Org-Parser'; # DIST
12             our $VERSION = '0.558'; # VERSION
13              
14             has link => (is => 'rw');
15             has description => (is => 'rw');
16             has from_radio_target => (is => 'rw');
17              
18             my ($self) = @_;
19             return $self->_str if defined $self->_str;
20 2     2 1 619 join("",
21 2 50       16 "[",
22 2 100 66     57 "[", $self->link, "]",
23             (defined($self->description) && length($self->description) ?
24             ("[", $self->description->as_string, "]") : ()),
25             "]");
26             }
27              
28             my $self = shift;
29             my $desc = $self->description;
30             defined($desc) ? $desc->as_text : $self->link;
31 2     2 1 1650 }
32 2         5  
33 2 100       8 1;
34             # ABSTRACT: Represent Org hyperlink
35              
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Org::Element::Link - Represent Org hyperlink
44              
45             =head1 VERSION
46              
47             This document describes version 0.558 of Org::Element::Link (from Perl distribution Org-Parser), released on 2022-06-23.
48              
49             =head1 DESCRIPTION
50              
51             Derived from L<Org::Element>.
52              
53             =head1 as_string => str
54              
55             From L<Org::Element>.
56              
57             =head2 as_text => str
58              
59             From L<Org::ElementRole::Inline>.
60              
61             =head1 ATTRIBUTES
62              
63             =head2 link => STR
64              
65             =head2 description => OBJ
66              
67             =head2 from_radio_target => BOOL
68              
69             =head1 METHODS
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>, and sometimes one or two other
97             Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required
98             beyond that are considered a bug and can be reported to me.
99              
100             =head1 COPYRIGHT AND LICENSE
101              
102             This software is copyright (c) 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
103              
104             This is free software; you can redistribute it and/or modify it under
105             the same terms as the Perl 5 programming language system itself.
106              
107             =head1 BUGS
108              
109             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
110              
111             When submitting a bug or request, please include a test-file or a
112             patch to an existing test-file that illustrates the bug or desired
113             feature.
114              
115             =cut