| 1 | package IPC::Simple::Message; | ||||||||||
| 2 | 4 | $IPC::Simple::Message::VERSION = '0.03'; | |||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | ▶ | use Types::Standard -types; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | use overload fallback => 1, | ||||||||||
| 10 | '""' => sub{ | ||||||||||
| 11 | 5 | ▶ | my $self = shift; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 5 | return $self->message; | |||||||||
| 13 | }, | ||||||||||
| 14 | '==' => sub{ | ||||||||||
| 15 | 4 | ▶ | my ($self, $other, $swap) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
| |||||||||||
| 16 | |||||||||||
| 17 | 4 | ▶ | if ($swap) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | ($self, $other) = ($other, $self); | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 4 | return $self->source == $other; | |||||||||
| 22 | 4 | ▶ | }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | |||||||||||
| 24 | 4 | ▶ | use constant IPC_STDIN => 0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 4 | ▶ | use constant IPC_STDOUT => 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 4 | ▶ | use constant IPC_STDERR => 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 4 | ▶ | use constant IPC_ERROR => 3; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | BEGIN{ | ||||||||||
| 30 | 4 | ▶ | extends 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | 4 | our @EXPORT = qw( | |||||||||
| 33 | IPC_STDIN | ||||||||||
| 34 | IPC_STDOUT | ||||||||||
| 35 | IPC_STDERR | ||||||||||
| 36 | IPC_ERROR | ||||||||||
| 37 | ); | ||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 4 | has source => | |||||||||
| 41 | is => 'ro', | ||||||||||
| 42 | isa => Enum[IPC_STDOUT, IPC_STDERR, IPC_ERROR], | ||||||||||
| 43 | required => 1; | ||||||||||
| 44 | |||||||||||
| 45 | 4 | has message => | |||||||||
| 46 | is => 'ro', | ||||||||||
| 47 | isa => Str, | ||||||||||
| 48 | required => 1; | ||||||||||
| 49 | |||||||||||
| 50 | 2 | ▶ | sub stdout { $_[0] == IPC_STDOUT } | ||||||||
|
Subroutine
stdout: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 51 | 2 | ▶ | sub stderr { $_[0] == IPC_STDERR } | ||||||||
|
Subroutine
stderr: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 52 | 0 | ▶ | sub error { $_[0] == IPC_ERROR } | ||||||||
|
Subroutine
error: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 53 | |||||||||||
| 54 | 4 | 1; | |||||||||
| 55 | |||||||||||
| 56 | __END__ | ||||||||||