| 1 | package Mason::Component::ClassMeta; | ||
| 2 | 12 | $Mason::Component::ClassMeta::VERSION = '2.24'; | |
| 3 | 21 | ▶ | use File::Basename; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 21 | ▶ | use Mason::Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 21 | ▶ | use Log::Any; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 12 | my $next_id = 0; | |
| 8 | |||
| 9 | # Passed attributes (generated in compiled component) | ||
| 10 | 12 | has 'class' => ( required => 1 ); | |
| 11 | 12 | has 'dir_path' => ( required => 1 ); | |
| 12 | 12 | has 'interp' => ( required => 1, weak_ref => 1 ); | |
| 13 | 12 | has 'is_dhandler' => ( init_arg => undef, lazy_build => 1 ); | |
| 14 | 12 | has 'is_top_level' => ( required => 1 ); | |
| 15 | 12 | has 'object_file' => ( required => 1 ); | |
| 16 | 12 | has 'path' => ( required => 1 ); | |
| 17 | 12 | has 'source_file' => ( required => 1 ); | |
| 18 | |||
| 19 | # Derived attributes | ||
| 20 | 227 | ▶ | has 'id' => ( init_arg => undef, default => sub { $next_id++ } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 21 | 12 | has 'log' => ( init_arg => undef, lazy_build => 1 ); | |
| 22 | 12 | has 'name' => ( init_arg => undef, lazy_build => 1 ); | |
| 23 | |||
| 24 | 0 | ▶ | method _build_is_dhandler () { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.6
Subroutine
_build_is_dhandler: called CC=1 SCAR=0.9
Subroutine
__ANON__: not called CC=1 SCAR=0.9
| |||
| 25 | 0 | return grep { $self->name eq $_ } @{ $self->interp->dhandler_names }; | |
| 26 | 12 | } | |
| 27 | |||
| 28 | 0 | ▶ | method _build_log () { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.6
Subroutine
_build_log: called CC=1 SCAR=0.9
Subroutine
__ANON__: not called CC=1 SCAR=0.9
| |||
| 29 | 0 | my $log_category = "Mason::Component" . $self->path; | |
| 30 | 0 | $log_category =~ s/\//::/g; | |
| 31 | 0 | return Log::Any->get_logger( category => $log_category ); | |
| 32 | 12 | } | |
| 33 | |||
| 34 | 0 | ▶ | method _build_name () { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.6
Subroutine
__ANON__: called CC=1 SCAR=0.8
Subroutine
_build_name: not called CC=1 SCAR=0.8
| |||
| 35 | 0 | return basename( $self->path ); | |
| 36 | 12 | } | |
| 37 | |||
| 38 | 12 | __PACKAGE__->meta->make_immutable(); | |
| 39 | |||
| 40 | 12 | 1; | |
| 41 | |||
| 42 | __END__ | ||