| 1 | package Workflow::Condition::Negated; | ||||||||||
| 2 | |||||||||||
| 3 | 29 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 29 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 29 | ▶ | use v5.14.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 29 | our $VERSION = '2.12'; | |||||||||
| 8 | |||||||||||
| 9 | 29 | ▶ | use parent qw( Workflow::Condition ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 29 | my @FIELDS = qw( name class negated ); | |||||||||
| 12 | 29 | __PACKAGE__->mk_accessors(@FIELDS); | |||||||||
| 13 | |||||||||||
| 14 | 9 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 15 | 9 | my ( $self, $params ) = @_; | |||||||||
| 16 | 9 | my $negated = $params->{name}; | |||||||||
| 17 | 9 | $self->SUPER::init( $params ); | |||||||||
| 18 | |||||||||||
| 19 | 9 | $negated =~ s/ \A ! //gx; | |||||||||
| 20 | 9 | $self->negated( $negated ); | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 39 | ▶ | sub evaluate { | ||||||||
|
Subroutine
evaluate: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | 39 | my ($self, $wf) = @_; | |||||||||
| 25 | 39 | ▶ | if ($self->evaluate_condition($wf, $self->negated)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 12 | return Workflow::Condition::IsFalse->new(); | |||||||||
| 27 | } else { | ||||||||||
| 28 | 26 | return Workflow::Condition::IsTrue->new(); | |||||||||
| 29 | } | ||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | 29 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||