| 1 | 25 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 25 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | # ABSTRACT: a tolerance "m >= n" | ||||||||||
| 4 | |||||||||||
| 5 | package | ||||||||||
| 6 | Number::Tolerant::Type::or_more; | ||||||||||
| 7 | 25 | ▶ | use parent qw(Number::Tolerant::Type); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 15 | ▶ | sub construct { shift; { value => $_[0], min => $_[0] } } | ||||||||
|
Subroutine
construct: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 10 | |||||||||||
| 11 | 22 | ▶ | sub parse { | ||||||||
|
Subroutine
parse: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 12 | 22 | my ($self, $string, $factory) = @_; | |||||||||
| 13 | 22 | my $number = $self->number_re; | |||||||||
| 14 | 22 | my $X = $self->variable_re; | |||||||||
| 15 | |||||||||||
| 16 | 22 | ▶ | return $factory->new("$1", 'or_more') if $string =~ m!\A($number)\s*<=$X\z!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 21 | ▶ | return $factory->new("$1", 'or_more') if $string =~ m!\A$X?>=\s*($number)\z!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 20 | ▶ | return $factory->new("$1", 'or_more') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | if $string =~ m!\A($number)\s+or\s+more\z!; | ||||||||||
| 20 | |||||||||||
| 21 | 19 | return; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 115 | ▶ | sub valid_args { | ||||||||
|
Subroutine
valid_args: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 25 | 115 | my $self = shift; | |||||||||
| 26 | |||||||||||
| 27 | 115 | ▶ | return unless 2 == grep { defined } @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 48 | ▶ | return unless $_[1] eq 'or_more'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 15 | return $self->normalize_number($_[0]); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 25 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||