| 1 | package Chloro::Result::Group; | ||||||||||
| 2 | |||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 11 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 11 | our $VERSION = '0.07'; | |||||||||
| 8 | |||||||||||
| 9 | 11 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 11 | ▶ | use MooseX::StrictConstructor; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 11 | ▶ | use Chloro::Error::Field; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 11 | ▶ | use Chloro::Types qw( Bool NonEmptyStr ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 11 | ▶ | use List::AllUtils qw( any ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 11 | with qw( Chloro::Role::Result Chloro::Role::ResultSet ); | |||||||||
| 17 | |||||||||||
| 18 | 11 | has group => ( | |||||||||
| 19 | is => 'ro', | ||||||||||
| 20 | isa => 'Chloro::Group', | ||||||||||
| 21 | required => 1, | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 11 | has key => ( | |||||||||
| 25 | is => 'ro', | ||||||||||
| 26 | isa => NonEmptyStr, | ||||||||||
| 27 | required => 1, | ||||||||||
| 28 | ); | ||||||||||
| 29 | |||||||||||
| 30 | 11 | has prefix => ( | |||||||||
| 31 | is => 'ro', | ||||||||||
| 32 | isa => NonEmptyStr, | ||||||||||
| 33 | required => 1, | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | 11 | has is_valid => ( | |||||||||
| 37 | is => 'ro', | ||||||||||
| 38 | isa => Bool, | ||||||||||
| 39 | init_arg => undef, | ||||||||||
| 40 | lazy => 1, | ||||||||||
| 41 | builder => '_build_is_valid', | ||||||||||
| 42 | ); | ||||||||||
| 43 | |||||||||||
| 44 | 6 | ▶ | sub _build_is_valid { | ||||||||
|
Subroutine
_build_is_valid: called CC=2 SCAR=6.9
| |||||||||||
| 45 | 6 | my $self = shift; | |||||||||
| 46 | |||||||||||
| 47 | 6 | ▶ | return 0 if any { !$_->is_valid() } $self->_result_values(); | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 5 | return 1; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 6 | ▶ | sub key_value_pairs { | ||||||||
|
Subroutine
key_value_pairs: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 53 | 6 | my $self = shift; | |||||||||
| 54 | 6 | my $skip_secure = shift; | |||||||||
| 55 | |||||||||||
| 56 | 20 | return map { $_->key_value_pairs() } | |||||||||
| 57 | 6 | ▶ | grep { $skip_secure ? !$_->field()->is_secure() : 1 } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | $self->_result_values(); | ||||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 11 | __PACKAGE__->meta()->make_immutable(); | |||||||||
| 62 | |||||||||||
| 63 | 11 | 1; | |||||||||
| 64 | |||||||||||
| 65 | # ABSTRACT: A result for a single group | ||||||||||
| 66 | |||||||||||
| 67 | __END__ | ||||||||||