| 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 = '2026-07-21'; # DATE | |||||||||||||||||||||||||||
| 12 | 6 | our $DIST = 'Org-Parser'; # DIST | |||||||||||||||||||||||||||
| 13 | 6 | our $VERSION = '0.563'; # VERSION | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 6 | has link => (is => 'rw'); | |||||||||||||||||||||||||||
| 16 | 6 | has description => (is => 'rw'); | |||||||||||||||||||||||||||
| 17 | 6 | has from_radio_target => (is => 'rw'); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | ▶ | sub as_string { | ||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||
| 20 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||
| 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 | 2 | ▶ | sub as_text { | ||||||||||||||||||||||||||
|
Subroutine
as_text: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||