| 1 | package Langertha::Role::StaticModels; | ||||||||||
| 2 | # ABSTRACT: Role for engines with a hardcoded model list | ||||||||||
| 3 | 55 | our $VERSION = '0.505'; | |||||||||
| 4 | 55 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | |||||||||||
| 7 | 55 | has static_models => ( | |||||||||
| 8 | is => 'ro', | ||||||||||
| 9 | isa => 'ArrayRef[HashRef]', | ||||||||||
| 10 | lazy_build => 1, | ||||||||||
| 11 | ); | ||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 10 | ▶ | sub list_models { | ||||||||
|
Subroutine
list_models: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | 10 | my ($self, %opts) = @_; | |||||||||
| 16 | 10 | my $models = $self->static_models; | |||||||||
| 17 | 10 | ▶ | return $opts{full} ? $models : [map { $_->{id} } @$models]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | 55 | 1; | |||||||||
| 23 | |||||||||||
| 24 | __END__ | ||||||||||