User/Identity/System.pm untested

filter: Statementstmt 0.0% 0 / 35 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 9 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 66 SCAR 17.9
CC
2
Cov
0%
location
6.0
type
2.0
init
2.0
CRAP 6.0
1 # Copyrights 2003-2022 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 # This code is part of distribution User-Identity. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package User::Identity::System;
10 use vars '$VERSION';
11 $VERSION = '1.01';
12  
13 use base 'User::Identity::Item';
14  
15 use strict;
16 use warnings;
17  
18 use User::Identity;
19 use Scalar::Util 'weaken';
20  
21  
22 sub type { "network" }
23  
24  
25 sub init($)
26 { my ($self, $args) = @_;
27  
28 $self->SUPER::init($args);
29 exists $args->{$_} && ($self->{'UIS_'.$_} = delete $args->{$_})
30 foreach qw/hostname location os password username/;
31  
32 $self->{UIS_hostname} ||= 'localhost';
33 $self;
34 }
35  
36  
37 sub hostname() { shift->{UIS_hostname} }
38  
39  
40 sub username() { shift->{UIS_username} }
41  
42  
43 sub os() { shift->{UIS_os} }
44  
45  
46 sub password() { shift->{UIS_password} }
47  
48  
49 sub location()
50 { my $self = shift;
51 my $location = $self->{MI_location} or return;
52  
53 unless(ref $location)
54 { my $user = $self->user or return;
55 $location = $user->find(location => $location);
56 }
57  
58 $location;
59 }
60  
61 1;
62