LDAP/Role/FromEntry.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 2 SCAR 2.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« LDAP/Command/Help.pm ↑ Summary LDAP/LDIF/Group.pm »
1 package App::LDAP::Role::FromEntry;
2  
3 7 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 7 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 with qw( App::LDAP::Role );
8  
9 10 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
10 10 my $orig = shift;
11 10 my $self = shift;
12 10 ▶ @_ = $self->entry_to_args(@_) if ref($_[0]) eq 'Net::LDAP::Entry';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "Net::LDAP::Entry" 5 5 10
13 10 $self->$orig(@_);
14 7 };
15  
16 5 ▶sub entry_to_args {
Subroutine entry_to_args: called CC=1 SCAR=0.0
Pod undocumented
17 5 my ($self, $entry) = @_;
18  
19 my %attrs = map {
20 5 my $asref = $self->meta->find_attribute_by_name($_)->type_constraint->name ~~ /Ref/;
21 31 $_, $entry->get_value($_, asref => $asref);
22 } $entry->attributes;
23  
24 5 return (dn => $entry->dn, %attrs);
25 }
26  
27 7 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 7 1;
« LDAP/Command/Help.pm ↑ Summary LDAP/LDIF/Group.pm »