| 1 | 2 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Moo (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use Moo::Role (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use Import::Into (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | package Monjon; | ||||||||||
| 11 | |||||||||||
| 12 | 2 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||
| 13 | 2 | our $VERSION = '0.004'; | |||||||||
| 14 | 2 | our @ISA = qw( Moo ); | |||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | do { require UNIVERSAL::DOES } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | if $] < 5.010000; | ||||||||||
| 18 | |||||||||||
| 19 | 3 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 3 | my $class = shift; | |||||||||
| 21 | 3 | my $caller = caller; | |||||||||
| 22 | |||||||||||
| 23 | 3 | 'Moo'->import::into($caller, @_); | |||||||||
| 24 | |||||||||||
| 25 | 3 | 'Moo::Role'->apply_roles_to_object( | |||||||||
| 26 | 'Moo'->_accessor_maker_for($caller), | ||||||||||
| 27 | 'Method::Generate::Accessor::Role::Monjon', | ||||||||||
| 28 | ); | ||||||||||
| 29 | |||||||||||
| 30 | 3 | 'Moo::Role'->apply_roles_to_object( | |||||||||
| 31 | 'Moo'->_constructor_maker_for($caller), | ||||||||||
| 32 | 'Method::Generate::Constructor::Role::Monjon', | ||||||||||
| 33 | ); | ||||||||||
| 34 | |||||||||||
| 35 | $caller->Class::Method::Modifiers::install_modifier( | ||||||||||
| 36 | before => 'has', | ||||||||||
| 37 | 6 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 38 | 6 | ▶ | $Monjon::INSTANCES_EXIST{$caller} | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | and Carp::croak("$caller has already been instantiated; cannot add attributes"); | ||||||||||
| 40 | }, | ||||||||||
| 41 | 3 | ); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 2 | __PACKAGE__ | |||||||||
| 45 | __END__ | ||||||||||