LDAP/LDIF/Group.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 27 / 27 CC 2 SCAR 2.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« LDAP/Role/FromEntry.pm ↑ Summary LDAP/LDIF/Host.pm »
1 package App::LDAP::LDIF::Group;
2  
3 3 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 extends qw(
8 App::LDAP::ObjectClass::PosixGroup
9 App::LDAP::LDIF
10 );
11  
12 2 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
13 2 my $orig = shift;
14 2 my $self = shift;
15 2 ▶ push @_, ( dn => "cn=" .{@_}->{cn}[0] . "," . {@_}->{base} ) if grep /^base$/, @_;
Branch: 1 branch
BranchTrueFalseTotal
if grep /^base$/u, @_ 1 1 2
16 2 $self->$orig(@_);
17 3 };
18  
19 has '+objectClass' => (
20 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
21 [
22 1 qw( posixGroup
23 top )
24 ]
25 },
26 3 );
27  
28 3 has '+userPassword' => (
29 default => "{crypt}x",
30 );
31  
32 3 __PACKAGE__->meta->make_immutable;
33 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 3 1;
36  
37 =pod
38  
39 =head1 NAME
40  
41 App::LDAP::LDIF::Group - the representation of groups in LDAP
42  
43 =head1 SYNOPSIS
44  
45 my $group = App::LDAP::LDIF::Group->new(
46 base => $base, # The OU (organization unit) which the group belongs to
47 cn => [$name], # the group name
48 gidNumber => $id, # the gid of the group
49 );
50 # these three attributes are required
51  
52 my $entry = $group->entry;
53 # get the group as a instance of Net::LDAP::Entry
54  
55 my $group = App::LDAP::LDIF::Group->new($entry)
56 # new from a entry
57  
58 =cut
« LDAP/Role/FromEntry.pm ↑ Summary LDAP/LDIF/Host.pm »