File Coverage

blib/lib/Workflow/Condition/Result.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition 2 2 100.0
subroutine 6 6 100.0
pod 2 2 100.0
total 30 30 100.0


line stmt bran cond sub pod time code
1             package Workflow::Condition::Result;
2              
3 38     38   304753 use warnings;
  38         96  
  38         2309  
4 38     38   259 use strict;
  38         76  
  38         1448  
5              
6 38     38   233 use parent qw( Class::Accessor );
  38         99  
  38         242  
7              
8 38     38   11604 use overload '""' => 'to_string';
  38         98  
  38         302  
9              
10             __PACKAGE__->mk_accessors('message');
11              
12             $Workflow::Condition::Result = '2.09';
13              
14             sub new {
15 107     107 1 663 my ( $class, @params ) = @_;
16 107         287 my $self = bless { }, $class;
17 107 100       358 $self->message( shift @params ) if (@params);
18 107         706 return $self;
19             }
20              
21             sub to_string {
22 113     113 1 290 my $self = shift;
23 113   100     533 return $self->message() || '<no message>';
24             }
25              
26             1;
27              
28             __END__
29              
30             =pod
31              
32             =head1 NAME
33              
34             Workflow::Condition::Result - Base class for condition results isTrue and isFalse
35              
36             =head1 VERSION
37              
38             This documentation describes version 2.09 of this package
39              
40             =head1 SYNOPSIS
41              
42             package Workflow::Condition::IsFalse;
43              
44             use parent qw(Workflow::Condition::Result);
45              
46             =head1 DESCRIPTION
47              
48             Base class for condition results L<Workflow::Condition::IsTrue> and L<Workflow::Condition::IsFalse>.
49              
50             =head1 METHODS
51              
52             =head2 Class Methods
53              
54             =head3 to_string
55              
56             Returns the message of the result object or the string '<no message>' if no message is set.
57              
58             =head1 SEE ALSO
59              
60             =over
61              
62             =item * L<Workflow::Condition>
63              
64             =item * L<Workflow::Condition::IsTrue>
65              
66             =item * L<Workflow::Condition::IsFalse>
67              
68             =back
69              
70             =head1 COPYRIGHT
71              
72             Copyright (c) 2004-2024 Chris Winters. All rights reserved.
73              
74             This library is free software; you can redistribute it and/or modify
75             it under the same terms as Perl itself.
76              
77             Please see the F<LICENSE>
78              
79             =head1 AUTHORS
80              
81             Please see L<Workflow>
82              
83             =cut