| 1 | package Bread::Board::Service::WithClass; | ||||||||||
| 2 | 70 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||
| 3 | # ABSTRACT: role for services returning instances of a given class | ||||||||||
| 4 | 70 | $Bread::Board::Service::WithClass::VERSION = '0.37'; | |||||||||
| 5 | 70 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 70 | ▶ | use Module::Runtime (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 70 | ▶ | use Bread::Board::Types; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 70 | with 'Bread::Board::Service'; | |||||||||
| 11 | |||||||||||
| 12 | 70 | has 'class' => ( | |||||||||
| 13 | is => 'rw', | ||||||||||
| 14 | isa => 'Str', | ||||||||||
| 15 | predicate => 'has_class', | ||||||||||
| 16 | ); | ||||||||||
| 17 | |||||||||||
| 18 | 229 | ▶ | before 'get' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 19 | 229 | my $self = shift; | |||||||||
| 20 | 229 | ▶ | Module::Runtime::require_module($self->class) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | if $self->has_class; | ||||||||||
| 22 | 70 | }; | |||||||||
| 23 | |||||||||||
| 24 | 70 | ▶ | no Moose::Role; 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||