| 1 | package Data::HTML::Element::A; | ||
| 2 | |||
| 3 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 8 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 0 | ▶ | use Data::HTML::Element::Utils qw(check_data check_data_type); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | use Error::Pure qw(err); | ||
| 8 | use List::Util 1.33 qw(none); | ||
| 9 | use Mo qw(build is); | ||
| 10 | use Mo::utils 0.15 qw(check_array check_strings); | ||
| 11 | use Mo::utils::CSS 0.02 qw(check_css_class); | ||
| 12 | use Readonly; | ||
| 13 | |||
| 14 | Readonly::Array our @TARGETS => qw(_blank _parent _self _top); | ||
| 15 | |||
| 16 | our $VERSION = 0.17; | ||
| 17 | |||
| 18 | has css_class => ( | ||
| 19 | is => 'ro', | ||
| 20 | ); | ||
| 21 | |||
| 22 | has data => ( | ||
| 23 | default => [], | ||
| 24 | ro => 1, | ||
| 25 | ); | ||
| 26 | |||
| 27 | has data_type => ( | ||
| 28 | ro => 1, | ||
| 29 | ); | ||
| 30 | |||
| 31 | has id => ( | ||
| 32 | ro => 1, | ||
| 33 | ); | ||
| 34 | |||
| 35 | has target => ( | ||
| 36 | ro => 1, | ||
| 37 | ); | ||
| 38 | |||
| 39 | has url => ( | ||
| 40 | is => 'ro', | ||
| 41 | ); | ||
| 42 | |||
| 43 | sub BUILD { | ||
| 44 | my $self = shift; | ||
| 45 | |||
| 46 | # Check CSS class. | ||
| 47 | check_css_class($self, 'css_class'); | ||
| 48 | |||
| 49 | # Check data type. | ||
| 50 | check_data_type($self); | ||
| 51 | |||
| 52 | # Check data based on type. | ||
| 53 | check_data($self); | ||
| 54 | |||
| 55 | # Check target. | ||
| 56 | check_strings($self, 'target', \@TARGETS); | ||
| 57 | |||
| 58 | return; | ||
| 59 | } | ||
| 60 | |||
| 61 | 1; | ||
| 62 | |||
| 63 | __END__ | ||