LDAP/LDIF/Host.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 26 / 26 CC 2 SCAR 2.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« LDAP/LDIF/Group.pm ↑ Summary LDAP/LDIF/OrgUnit.pm »
1 package App::LDAP::LDIF::Host;
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::IpHost
9 App::LDAP::ObjectClass::Device
10 App::LDAP::LDIF
11 );
12  
13 2 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
14 2 my $orig = shift;
15 2 my $self = shift;
16 2 ▶ push @_, ( dn => "cn=" . {@_}->{cn}[0] . "," . {@_}->{base} ) if grep /^base$/, @_;
Branch: 1 branch
BranchTrueFalseTotal
if grep /^base$/u, @_ 1 1 2
17 2 $self->$orig(@_);
18 3 };
19  
20 has '+objectClass' => (
21 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
22 [
23 1 qw( top
24 ipHost
25 device )
26 ]
27 },
28 3 );
29  
30 3 __PACKAGE__->meta->make_immutable;
31 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 3 1;
34  
35 =pod
36  
37 =head1 NAME
38  
39 App::LDAP::LDIF::Host - the representation of hosts in LDAP
40  
41 =head1 SYNOPSIS
42  
43 my $host = App::LDAP::LDIF::Host->new(
44 base => $base, # the OU (organization unit) which the host belongs to
45 cn => [$name1, $name2], # the host name
46 ipHostNumber => $ipHostNumber, # the ip of this host
47 );
48  
49 my $entry = $host->entry;
50 # get the host as a instance of Net::Ldap::Entry
51  
52 my $host = App::LDAP::LDIF::Host->new($entry)
53 # new from a Net::LDAP::Entry instance
54  
55 =cut
« LDAP/LDIF/Group.pm ↑ Summary LDAP/LDIF/OrgUnit.pm »