File Coverage

blib/lib/SIAM/Device.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::Device;
2              
3 2     2   11 use warnings;
  2         4  
  2         54  
4 2     2   10 use strict;
  2         4  
  2         55  
5              
6 2     2   9 use base 'SIAM::Object';
  2         4  
  2         125  
7              
8 2     2   1660 use SIAM::DeviceComponent;
  2         5  
  2         63  
9              
10             =head1 NAME
11              
12             SIAM::Device - device object class
13              
14             =head1 SYNOPSIS
15              
16              
17             =head1 METHODS
18              
19             =head2 get_components
20              
21             Returns arrayref with SIAM::DeviceComponent objects
22              
23             =cut
24              
25             sub get_components
26             {
27 1     1 1 429 my $self = shift;
28 1         10 return $self->get_contained_objects('SIAM::DeviceComponent');
29             }
30              
31              
32             # mandatory attributes
33              
34             my $mandatory_attributes =
35             [ 'siam.device.inventory_id',
36             'siam.device.name'];
37              
38             sub _mandatory_attributes
39             {
40 5     5   14 return $mandatory_attributes;
41             }
42              
43             sub _manifest_attributes
44             {
45 1     1   3 my $ret = [];
46 1         2 push(@{$ret}, @{$mandatory_attributes},
  1         4  
  1         9  
47 1         2 @{ SIAM::DeviceComponent->_manifest_attributes() });
48 1         8 return $ret;
49             }
50              
51             1;
52              
53             # Local Variables:
54             # mode: cperl
55             # indent-tabs-mode: nil
56             # cperl-indent-level: 4
57             # cperl-continued-statement-offset: 4
58             # cperl-continued-brace-offset: -4
59             # cperl-brace-offset: 0
60             # cperl-label-offset: -2
61             # End: