« blib/lib/Rose/HTML/Image.pm
↑ Summary
blib/lib/Rose/HTML/Form/Field/DateTime/Split/MonthDayYear.pm »
| 1 | package Rose::HTML::Object::WithWrapAroundChildren; | ||||||||||
| 2 | |||||||||||
| 3 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 13 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 13 | our $VERSION = '0.554'; | |||||||||
| 8 | |||||||||||
| 9 | use Rose::HTML::Object::MakeMethods::Generic | ||||||||||
| 10 | 13 | ▶ | ( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 13 | array => | |||||||||
| 12 | [ | ||||||||||
| 13 | 'pre_children' => {}, | ||||||||||
| 14 | 'shift_pre_children' => { interface => 'shift', hash_key => 'pre_children' }, | ||||||||||
| 15 | 'unshift_pre_children' => { interface => 'unshift', hash_key => 'pre_children' }, | ||||||||||
| 16 | 'pop_pre_children' => { interface => 'pop', hash_key => 'pre_children' }, | ||||||||||
| 17 | 'push_pre_children' => { interface => 'push', hash_key => 'pre_children' }, | ||||||||||
| 18 | 'delete_pre_children' => { interface => 'clear', hash_key => 'pre_children' }, | ||||||||||
| 19 | |||||||||||
| 20 | 'post_children' => {}, | ||||||||||
| 21 | 'shift_post_children' => { interface => 'shift', hash_key => 'post_children' }, | ||||||||||
| 22 | 'unshift_post_children' => { interface => 'unshift', hash_key => 'post_children' }, | ||||||||||
| 23 | 'push_post_children' => { interface => 'push', hash_key => 'post_children' }, | ||||||||||
| 24 | 'pop_post_children' => { interface => 'pop', hash_key => 'post_children' }, | ||||||||||
| 25 | 'delete_post_children' => { interface => 'clear', hash_key => 'post_children' }, | ||||||||||
| 26 | ], | ||||||||||
| 27 | 13 | ); | |||||||||
| 28 | |||||||||||
| 29 | sub children | ||||||||||
| 30 | 1197 | ▶ | { | ||||||||
|
Subroutine
children: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||
| 31 | 1197 | my($self) = shift; | |||||||||
| 32 | 1197 | ▶ | Carp::croak "Cannot directly set children() for a ", ref($self), | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | ". Use fields(), push_children(), pop_children(), etc." if(@_); | ||||||||||
| 34 | 1197 | ▶ | return wantarray ? ($self->pre_children, $self->immutable_children(), $self->post_children) : | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | [ $self->pre_children, $self->immutable_children(), $self->post_children ]; | ||||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 4 | ▶ | sub push_children { shift->push_post_children(@_) } | ||||||||
|
Subroutine
push_children: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 39 | |||||||||||
| 40 | sub pop_children | ||||||||||
| 41 | 4 | ▶ | { | ||||||||
|
Subroutine
pop_children: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||
| 42 | 4 | my($self) = shift; | |||||||||
| 43 | |||||||||||
| 44 | 4 | ▶ | my $num = @_ ? shift : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 4 | my @children = $self->pop_post_children($num); | |||||||||
| 46 | |||||||||||
| 47 | 4 | ▶ | if(@children < $num) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | { | ||||||||||
| 49 | 1 | push(@children, $self->pop_pre_children($num - @children)); | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 4 | ▶ | return @children == 1 ? $children[0] : @children; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | sub shift_children | ||||||||||
| 56 | 2 | ▶ | { | ||||||||
|
Subroutine
shift_children: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||
| 57 | 2 | my($self) = shift; | |||||||||
| 58 | |||||||||||
| 59 | 2 | ▶ | my $num = @_ ? shift : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | 2 | my @children = $self->shift_pre_children($num); | |||||||||
| 61 | |||||||||||
| 62 | 2 | ▶ | if(@children < $num) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | { | ||||||||||
| 64 | 1 | push(@children, $self->shift_post_children($num - @children)); | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | 2 | ▶ | return @children == 1 ? $children[0] : @children; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 3 | ▶ | sub unshift_children { shift->unshift_pre_children(@_) } | ||||||||
|
Subroutine
unshift_children: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 71 | |||||||||||
| 72 | 13 | 1; | |||||||||