line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UR::BoolExpr::Template::PropertyComparison::Equals; |
2
|
266
|
|
|
266
|
|
961
|
use strict; |
|
266
|
|
|
|
|
324
|
|
|
266
|
|
|
|
|
6252
|
|
3
|
266
|
|
|
266
|
|
873
|
use warnings; |
|
266
|
|
|
|
|
307
|
|
|
266
|
|
|
|
|
5669
|
|
4
|
266
|
|
|
266
|
|
904
|
use UR; |
|
266
|
|
|
|
|
313
|
|
|
266
|
|
|
|
|
1338
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.46"; # UR $VERSION; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
UR::Object::Type->define( |
8
|
|
|
|
|
|
|
class_name => __PACKAGE__, |
9
|
|
|
|
|
|
|
is => ['UR::BoolExpr::Template::PropertyComparison'], |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _compare { |
13
|
1632
|
|
|
1632
|
|
2011
|
my ($class,$comparison_value,@property_values) = @_; |
14
|
|
|
|
|
|
|
|
15
|
266
|
|
|
266
|
|
17340
|
no warnings 'uninitialized'; |
|
266
|
|
|
|
|
374
|
|
|
266
|
|
|
|
|
15710
|
|
16
|
1632
|
100
|
|
|
|
2754
|
if (@property_values == 0) { |
17
|
25
|
100
|
|
|
|
149
|
return ($comparison_value eq '' ? 1 : ''); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
266
|
|
|
266
|
|
925
|
no warnings 'numeric'; |
|
266
|
|
|
|
|
339
|
|
|
266
|
|
|
|
|
26815
|
|
21
|
1607
|
|
|
|
|
3572
|
my $cv_is_number = Scalar::Util::looks_like_number($comparison_value); |
22
|
|
|
|
|
|
|
|
23
|
1607
|
|
|
|
|
1889
|
foreach my $property_value ( @property_values ) { |
24
|
1621
|
|
|
|
|
2029
|
my $pv_is_number = Scalar::Util::looks_like_number($property_value); |
25
|
1621
|
100
|
66
|
|
|
3799
|
if ($pv_is_number and $cv_is_number) { |
26
|
396
|
100
|
|
|
|
1835
|
return 1 if $property_value == $comparison_value; |
27
|
|
|
|
|
|
|
} else { |
28
|
1225
|
100
|
|
|
|
3531
|
return 1 if $property_value eq $comparison_value; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
991
|
|
|
|
|
2573
|
return ''; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
UR::BoolExpr::Template::PropertyComparison::Equals - perform a strictly equals test |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
If the property returns multiple values, this comparison returns true if any of the values are equal to the comparison value |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |