| 1 | package HTML::Acronyms; | ||||||||||
| 2 | 2 | $HTML::Acronyms::VERSION = '0.0.2'; | |||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use 5.014; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | has 'dict' => ( | |||||||||
| 12 | is => 'ro', | ||||||||||
| 13 | required => 1, | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | sub abbr | ||||||||||
| 17 | { | ||||||||||
| 18 | 2 | ▶ | my ( $self, $args ) = @_; | ||||||||
|
Subroutine
abbr: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||
| 19 | |||||||||||
| 20 | 2 | my $key = $args->{key}; | |||||||||
| 21 | 2 | my $no_link = $args->{no_link}; | |||||||||
| 22 | |||||||||||
| 23 | 2 | my $rec = $self->dict->{$key}; | |||||||||
| 24 | |||||||||||
| 25 | 2 | ▶ | if ( !defined $rec ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | { | ||||||||||
| 27 | 0 | Carp::confess("unknown key '$key'!"); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 2 | my $tag = qq{<abbr title="$rec->{title}">$rec->{abbr}</abbr>}; | |||||||||
| 31 | |||||||||||
| 32 | 2 | ▶ | return +{ html => ( $no_link ? $tag : qq{<a href="$rec->{url}">$tag</a>} ), | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | }; | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 2 | 1; | |||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||