ZeroMQ/Publish/Trait/Topics.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package AnyEvent::ZeroMQ::Publish::Trait::Topics;
2 BEGIN {
3 $AnyEvent::ZeroMQ::Publish::Trait::Topics::VERSION = '0.01';
4 }
5 # ABSTRACT: trait to prefix a message with a topic
6 use Moose::Role;
7 use true;
8 use namespace::autoclean;
9  
10 requires 'mangle_message';
11 around 'mangle_message' => sub {
12 my ($orig, $self, $msg, %args) = @_;
13 my $topic = delete $args{topic};
14 $msg = "$topic$msg" if defined $topic;
15 return $self->$orig($msg, %args);
16 };
17  
18 __END__