File Coverage

blib/lib/SIAM/ServiceUnit.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1             package SIAM::ServiceUnit;
2              
3 2     2   12 use warnings;
  2         4  
  2         61  
4 2     2   11 use strict;
  2         4  
  2         157  
5              
6 2     2   11 use base 'SIAM::Object';
  2         3  
  2         130  
7              
8 2     2   1289 use SIAM::ServiceComponent;
  2         6  
  2         21  
9              
10             =head1 NAME
11              
12             SIAM::ServiceUnit - Service Unit object class
13              
14             =head1 SYNOPSIS
15              
16             my $components = $svcunit->get_components();
17              
18             =head1 METHODS
19              
20             =head2 get_components
21              
22             Returns arrayref with SIAM::ServiceComponent objects
23              
24             =cut
25              
26             sub get_components
27             {
28 1     1 1 716 my $self = shift;
29 1         11 return $self->get_contained_objects('SIAM::ServiceComponent');
30             }
31              
32              
33            
34            
35             # mandatory attributes
36              
37             my $mandatory_attributes =
38             [ 'siam.svcunit.name',
39             'siam.svcunit.type',
40             'siam.svcunit.inventory_id', ];
41              
42             sub _mandatory_attributes
43             {
44 7     7   25 return $mandatory_attributes;
45             }
46              
47              
48             sub _manifest_attributes
49             {
50 1     1   3 my $ret = [];
51 1         2 push(@{$ret}, @{$mandatory_attributes},
  1         3  
  1         8  
52 1         3 @{ SIAM::ServiceComponent->_manifest_attributes() });
53              
54 1         5 return $ret;
55              
56             }
57              
58              
59             1;
60              
61             # Local Variables:
62             # mode: cperl
63             # indent-tabs-mode: nil
64             # cperl-indent-level: 4
65             # cperl-continued-statement-offset: 4
66             # cperl-continued-brace-offset: -4
67             # cperl-brace-offset: 0
68             # cperl-label-offset: -2
69             # End: