| 1 | # Copyright (c) 1998-2005 by Jonathan Swartz. All rights reserved. | ||||||||||
| 2 | # This program is free software; you can redistribute it and/or modify | ||||||||||
| 3 | # it under the same terms as Perl itself. | ||||||||||
| 4 | |||||||||||
| 5 | package HTML::Mason::Component::Subcomponent; | ||||||||||
| 6 | 31 | $HTML::Mason::Component::Subcomponent::VERSION = '1.59'; | |||||||||
| 7 | 31 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 31 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 31 | ▶ | use HTML::Mason::Component; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 31 | ▶ | use vars qw(@ISA); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 31 | @ISA = qw(HTML::Mason::Component); | |||||||||
| 15 | |||||||||||
| 16 | 31 | ▶ | use HTML::Mason::MethodMaker ( read_only => [ qw( comp_id is_method name owner path ) ] ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | # | ||||||||||
| 19 | # Assign parent, name, and is_method flag when owner component is created. | ||||||||||
| 20 | # | ||||||||||
| 21 | sub assign_subcomponent_properties { | ||||||||||
| 22 | 121 | ▶ | my $self = shift; | ||||||||
|
Subroutine
assign_subcomponent_properties: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 23 | 121 | ($self->{owner}, $self->{name}, $self->{is_method}) = @_; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | # | ||||||||||
| 27 | # Override path that would be set by parent's version of method. | ||||||||||
| 28 | # | ||||||||||
| 29 | sub assign_runtime_properties { | ||||||||||
| 30 | 121 | ▶ | my ($self, $interp, $source) = @_; | ||||||||
|
Subroutine
assign_runtime_properties: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 31 | 121 | $self->SUPER::assign_runtime_properties($interp, $source); | |||||||||
| 32 | 121 | ▶ | $self->{comp_id} = sprintf("[%s '%s' of %s]", $self->{is_method} ? 'method' : 'subcomponent', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | $self->name, $self->owner->comp_id); | ||||||||||
| 34 | 121 | my $owner_path = $self->owner->path; | |||||||||
| 35 | 121 | ▶ | $owner_path = q{} unless defined $owner_path; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 121 | $self->{path} = $owner_path . ":" . $self->name; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | sub cache_file { return $_[0]->owner->cache_file } | ||||||||
|
Subroutine
cache_file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 40 | 0 | ▶ | sub load_time { return $_[0]->owner->load_time } | ||||||||
|
Subroutine
load_time: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | 0 | ▶ | sub compiler_id { return $_[0]->owner->compilation_params } | ||||||||
|
Subroutine
compiler_id: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 42 | 127 | ▶ | sub dir_path { return $_[0]->owner->dir_path } | ||||||||
|
Subroutine
dir_path: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 43 | 25 | ▶ | sub is_subcomp { 1 } | ||||||||
|
Subroutine
is_subcomp: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 44 | 0 | ▶ | sub object_file { return $_[0]->owner->object_file } | ||||||||
|
Subroutine
object_file: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 45 | 0 | ▶ | sub parent { return $_[0]->owner->parent } | ||||||||
|
Subroutine
parent: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | 0 | ▶ | sub persistent { return $_[0]->owner->persistent } | ||||||||
|
Subroutine
persistent: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 47 | 11 | ▶ | sub title { return $_[0]->owner->title . ":" . $_[0]->name } | ||||||||
|
Subroutine
title: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 48 | |||||||||||
| 49 | 31 | 1; | |||||||||
| 50 | |||||||||||
| 51 | __END__ | ||||||||||