| 1 | package Cinnamon::Role; | ||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 4 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | ▶ | use Hash::MultiValue; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | has name => (is => 'ro', required => 1); | |||||||||
| 9 | 4 | has hosts => (is => 'ro', required => 1); | |||||||||
| 10 | 3 | ▶ | has params => (is => 'ro', default => sub { Hash::MultiValue->new }); | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 22 | ▶ | sub get_hosts { | ||||||||
|
Subroutine
get_hosts: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 13 | 22 | my ($self) = @_; | |||||||||
| 14 | 22 | my $hosts = $self->hosts; | |||||||||
| 15 | 22 | ▶ | if (ref $hosts eq 'CODE') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 2 | return $hosts->(); | |||||||||
| 17 | } | ||||||||||
| 18 | 20 | ▶ | return ref $hosts eq 'ARRAY' ? $hosts : [$hosts]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | sub info { | ||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 22 | 1 | my ($self) = @_; | |||||||||
| 23 | return +{ | ||||||||||
| 24 | 1 | hosts => $self->get_hosts, | |||||||||
| 25 | params => $self->params->as_hashref, | ||||||||||
| 26 | }; | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 4 | 1; | |||||||||