| 1 | package | ||||||||||
| 2 | Pinto::Remote::SelfContained::Result; | ||||||||||
| 3 | # ABSTRACT: the result of running an Action | ||||||||||
| 4 | |||||||||||
| 5 | 5 | ▶ | use v5.10; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 5 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 5 | ▶ | use Types::Standard qw(Bool); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 5 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 5 | our $VERSION = '1.999'; # TRIAL VERSION | |||||||||
| 13 | |||||||||||
| 14 | 5 | ▶ | use overload q[""] => 'to_string'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 5 | has made_changes => ( | |||||||||
| 17 | is => 'ro', | ||||||||||
| 18 | isa => Bool, | ||||||||||
| 19 | writer => '_set_made_changes', | ||||||||||
| 20 | default => 0, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 5 | has was_successful => ( | |||||||||
| 24 | is => 'ro', | ||||||||||
| 25 | isa => Bool, | ||||||||||
| 26 | writer => '_set_was_successful', | ||||||||||
| 27 | default => 1, | ||||||||||
| 28 | ); | ||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub exceptions {} | ||||||||
|
Subroutine
exceptions: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 31 | 0 | ▶ | sub add_exception {} | ||||||||
|
Subroutine
add_exception: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub failed { | ||||||||
|
Subroutine
failed: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 34 | 0 | my ($self, %args) = @_; | |||||||||
| 35 | |||||||||||
| 36 | # ignore "because" arg | ||||||||||
| 37 | 0 | $self->_set_was_successful(0); | |||||||||
| 38 | 0 | return $self; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub changed { | ||||||||
|
Subroutine
changed: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 42 | 0 | my ($self) = @_; | |||||||||
| 43 | |||||||||||
| 44 | 0 | $self->_set_made_changes(1); | |||||||||
| 45 | 0 | return $self; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | sub exit_status { | ||||||||
|
Subroutine
exit_status: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 49 | 0 | my ($self) = @_; | |||||||||
| 50 | |||||||||||
| 51 | 0 | ▶ | return $self->was_successful ? 0 : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 0 | ▶ | sub to_string { | ||||||||
|
Subroutine
to_string: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 55 | 0 | my ($self) = @_; | |||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | return $self->was_successful ? 'ok' : 'unknown error'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | 5 | 1; | |||||||||
| 61 | |||||||||||
| 62 | __END__ | ||||||||||