| 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
| |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | join("", | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $self->description and length $self->description
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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||