| 1 | package Chart::GGPlot::HasRequiredAes; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # ABSTRACT: The role for the 'required_aes' attr | ||||||||||||||
| 4 | |||||||||||||||
| 5 | 8 | ▶ | use Chart::GGPlot::Role; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 8 | ▶ | use namespace::autoclean; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | |||||||||||||||
| 8 | 8 | our $VERSION = '0.002003'; # VERSION | |||||||||||||
| 9 | |||||||||||||||
| 10 | 8 | ▶ | use Types::Standard qw(ArrayRef); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | |||||||||||||||
| 13 | 11 | ▶ | classmethod required_aes() { [] } | ||||||||||||
|
Subroutine
required_aes: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| |||||||||||||||
| 14 | |||||||||||||||
| 15 | |||||||||||||||
| 16 | 13 | ▶ | method check_required_aes($aesthetics) { | ||||||||||||
|
Subroutine
check_required_aes: called CC=4 SCAR=14.4
Pod
documented
Branch: 2 branches
| |||||||||||||||
| 17 | 13 | my %aesthetics = map { $_ => 1 } @$aesthetics; | |||||||||||||
| 18 | 13 | ▶ | my $missing_aes = $self->required_aes->grep(sub { !exists $aesthetics{$_} } ); | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 19 | 13 | ▶ | return if @$missing_aes == 0; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 20 | |||||||||||||||
| 21 | 0 | croak( sprintf("%s requires the following missing aesthetics: %s", | |||||||||||||
| 22 | ref($self), join( ', ', @$missing_aes ) )); | ||||||||||||||
| 23 | 8 | } | |||||||||||||
| 24 | |||||||||||||||
| 25 | 8 | 1; | |||||||||||||
| 26 | |||||||||||||||
| 27 | __END__ | ||||||||||||||