1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
package UR::BoolExpr::Template::PropertyComparison::GreaterThan;
use strict;
use warnings;
require UR;
our $VERSION = "0.47"; # UR $VERSION;
UR::Object::Type->define(
class_name => __PACKAGE__,
is => ['UR::BoolExpr::Template::PropertyComparison'],
);
sub _compare {
my ($class,$comparison_value,@property_value) = @_;
my $cv_is_number = Scalar::Util::looks_like_number($comparison_value);
no warnings 'uninitialized';
foreach my $property_value ( @property_value ) {
my $pv_is_number = Scalar::Util::looks_like_number($property_value);
if ($cv_is_number and $pv_is_number) {
return 1 if ( $property_value > $comparison_value );
} else {
return 1 if ( $property_value gt $comparison_value );
}
}
return '';
}
1;
=pod
=head1 NAME
UR::BoolExpr::Template::PropertyComparison::GreaterThan - perform a greater than test
=head1 DESCRIPTION
If the property returns multiple values, this comparison returns true if any of the values are
greater than the comparison value
=cut
|