blib/lib/UR/BoolExpr/Template/PropertyComparison/True.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 SCAR 24.8
CC
3
Cov
0%
_compare
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 12.0
1  
2 package UR::BoolExpr::Template::PropertyComparison::True;
3  
4 use strict;
5 use warnings;
6 use UR;
7 our $VERSION = "0.46"; # UR $VERSION;
8  
9 UR::Object::Type->define(
10 class_name => __PACKAGE__,
11 is => ['UR::BoolExpr::Template::PropertyComparison'],
12 );
13  
14 sub _compare {
15 my ($class,$comparison_value,@property_value) = @_;
16 no warnings;
17 if (@property_value == 0) {
18 return '';
19  
20 } else {
21 for (@property_value) {
22 return 1 if ($_); # Returns true if _any_ of the values are true
23 }
24 return '';
25 }
26 }
27  
28  
29 1;
30  
31 =pod
32  
33 =head1 NAME
34  
35 UR::BoolExpr::Template::PropertyComparison::True - Evaluates to true if the property's value is true
36  
37 If the property returns multiple values, this comparison returns true if any of the values are true
38  
39 =cut