| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package UR::BoolExpr::Template::PropertyComparison::NotEquals; |
|
3
|
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
236
|
use strict; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
124
|
|
|
5
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
112
|
|
|
6
|
4
|
|
|
4
|
|
14
|
use UR; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
23
|
|
|
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
|
44
|
|
|
44
|
|
64
|
my ($class,$comparison_value,@property_value) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
4
|
|
|
4
|
|
12
|
no warnings 'uninitialized'; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
526
|
|
|
18
|
44
|
50
|
|
|
|
81
|
if (@property_value == 0) { |
|
19
|
0
|
0
|
|
|
|
0
|
return ($comparison_value eq '' ? '' : 1); |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
44
|
|
|
|
|
104
|
my $cv_is_number = Scalar::Util::looks_like_number($comparison_value); |
|
23
|
|
|
|
|
|
|
|
|
24
|
44
|
|
|
|
|
56
|
foreach my $property_value ( @property_value ) { |
|
25
|
44
|
|
|
|
|
55
|
my $pv_is_number = Scalar::Util::looks_like_number($property_value); |
|
26
|
|
|
|
|
|
|
|
|
27
|
44
|
100
|
66
|
|
|
142
|
if ($cv_is_number and $pv_is_number) { |
|
28
|
36
|
50
|
|
|
|
70
|
return '' if ( $property_value == $comparison_value ); |
|
29
|
|
|
|
|
|
|
} else { |
|
30
|
8
|
50
|
|
|
|
18
|
return '' if ( $property_value eq $comparison_value ); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
} |
|
33
|
44
|
|
|
|
|
173
|
return 1; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
UR::BoolExpr::Template::PropertyComparison::NotEqual - perform a not-equal test |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
If the property returns multiple values, this comparison returns false if any if the values |
|
48
|
|
|
|
|
|
|
are equal to the comparison value |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |