| 1 | # Tiny helper class to return both output and return_code when testing | ||
| 2 | |||
| 3 | package Nagios::Monitoring::Plugin::ExitResult; | ||
| 4 | |||
| 5 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # Stringify to message | ||
| 8 | 3 | ▶ | use overload '""' => sub { shift->{message} }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | # Constructor | ||
| 11 | 89 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 12 | 89 | my $class = shift; | |
| 13 | 89 | return bless { return_code => $_[0], message => $_[1] }, $class; | |
| 14 | } | ||
| 15 | |||
| 16 | # Accessors | ||
| 17 | 83 | ▶ | sub message { shift->{message} } |
|
Subroutine
message: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 76 | ▶ | sub return_code { shift->{return_code} } |
|
Subroutine
return_code: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 19 | 0 | ▶ | sub code { shift->{return_code} } |
|
Subroutine
code: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 20 | |||
| 21 | 3 | 1; | |
| 22 | |||
| 23 | __END__ | ||