File Coverage

blib/lib/SIAM/Contract.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::Contract;
2              
3 2     2   11 use warnings;
  2         100  
  2         59  
4 2     2   9 use strict;
  2         4  
  2         61  
5              
6 2     2   8 use base 'SIAM::Object';
  2         3  
  2         130  
7              
8 2     2   1111 use SIAM::Service;
  2         6  
  2         23  
9              
10             =head1 NAME
11              
12             SIAM::Contract - Contract object class
13              
14             =head1 SYNOPSIS
15              
16             my $all_contracts = $siam->get_all_contracts();
17             my $user_contracts =
18             $siam->get_contracts_by_user_privilege($user, 'ViewContract');
19              
20             my $services = $contract->get_services();
21              
22             =head1 METHODS
23              
24             =head2 get_services
25              
26             Returns arrayref with SIAM::Service objects
27              
28             =cut
29              
30             sub get_services
31             {
32 1     1 1 2 my $self = shift;
33 1         11 return $self->get_contained_objects('SIAM::Service');
34             }
35              
36              
37             # mandatory attributes
38              
39             my $mandatory_attributes =
40             [ 'siam.contract.inventory_id',
41             'siam.contract.customer_name',
42             'siam.contract.customer_id',];
43              
44             sub _mandatory_attributes
45             {
46 8     8   28 return $mandatory_attributes;
47             }
48              
49             sub _manifest_attributes
50             {
51 1     1   4 my $ret = [];
52 1         2 push(@{$ret}, @{$mandatory_attributes},
  1         3  
  1         9  
53 1         2 @{ SIAM::Service->_manifest_attributes() });
54              
55 1         13 return $ret;
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: