blib/lib/Log/Message/Structured/Stringify/AsSereal.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 28 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 #
2 # This file is part of Log-Message-Structured-Stringify-AsSereal
3 #
4 # This software is copyright (c) 2013 by Damien "dams" Krotkine.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 package Log::Message::Structured::Stringify::AsSereal;
10 {
11 2 $Log::Message::Structured::Stringify::AsSereal::VERSION = '0.11';
12 }
13 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 ▶use Sereal::Encoder;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 2 requires 'as_hash';
20  
21 has '_sereal_encoder' => (
22 is => 'ro',
23 lazy => 1,
24 1 ▶ default => sub { Sereal::Encoder->new( {} ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
25 2 );
26  
27  
28 2 ▶around 'as_string' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
29 2 my $orig = shift;
30 2 my $self = shift;
31 2 return encode_base64($self->_sereal_encoder->encode($self->as_hash));
32 2 };
33  
34  
35 2 1;
36  
37 __END__
↑ Summary