blib/lib/UR/Object/Type/AccessorWriter/Product.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 SCAR 6.9
CC
1
Cov
0%
calculate
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package UR::Object::Type::AccessorWriter::Product;
3  
4 use strict;
5 use warnings;
6 require UR;
7 our $VERSION = "0.46"; # UR $VERSION;
8  
9 sub calculate {
10 my $self = shift;
11 my $object = shift;
12 my $properties = shift;
13 my $total = 1;
14 for my $property (@$properties) {
15 $total *= $object->$property
16 }
17 return $total;
18 };
19  
20 1;
21  
22 =pod
23  
24 =head1 NAME
25  
26 UR::Object::Type::AccessorWriter::Product - Implements a calculation accessor which multiplies the values of its properties
27  
28 =cut