| 1 | package MouseX::Foreign::Meta::Role::Method::Constructor; | ||||||||||||||
| 2 | 30 | ▶ | use Mouse::Role; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | |||||||||||||||
| 4 | 72 | ▶ | around _generate_constructor => sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 72 | my($next, undef, $meta, $option) = @_; | |||||||||||||
| 6 | |||||||||||||||
| 7 | # The foreign superlcass must have the new method | ||||||||||||||
| 8 | 72 | my $foreign_buildargs = $meta->name->can('FOREIGNBUILDARGS'); | |||||||||||||
| 9 | 72 | my $foreign_superclass = $meta->foreign_superclass; | |||||||||||||
| 10 | 72 | my $super_new = $foreign_superclass->can('new'); | |||||||||||||
| 11 | 72 | my $needs_buildall = !$foreign_superclass->can('BUILDALL'); | |||||||||||||
| 12 | |||||||||||||||
| 13 | 49 | ▶ | return sub { | ||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||
| 14 | 49 | my $class = shift; | |||||||||||||
| 15 | 49 | my $args = $class->BUILDARGS(@_); | |||||||||||||
| 16 | 49 | ▶ | my $object = $foreign_buildargs | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 17 | ? $class->$super_new($class->$foreign_buildargs(@_)) | ||||||||||||||
| 18 | : $class->$super_new( @_ ); | ||||||||||||||
| 19 | 49 | $object->meta->_initialize_object($object, $args); | |||||||||||||
| 20 | 49 | ▶ | $object->BUILDALL($args) if $needs_buildall; | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 21 | |||||||||||||||
| 22 | 49 | return $object; | |||||||||||||
| 23 | 72 | }; | |||||||||||||
| 24 | 17 | }; | |||||||||||||
| 25 | |||||||||||||||
| 26 | 30 | ▶ | no Mouse::Role; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 27 | 17 | 1; | |||||||||||||
| 28 | __END__ | ||||||||||||||