File Coverage

blib/lib/MsgPack/Decoder/Generator/FixInt.pm
Criterion Covered Total %
statement 10 10 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package MsgPack::Decoder::Generator::FixInt;
2             our $AUTHORITY = 'cpan:YANICK';
3             $MsgPack::Decoder::Generator::FixInt::VERSION = '2.0.2';
4 3     3   1730 use Moose;
  3         9  
  3         23  
5 3     3   20829 use MooseX::MungeHas 'is_ro';
  3         9  
  3         26  
6              
7             extends 'MsgPack::Decoder::Generator';
8              
9 54     54   2030 has '+bytes' => sub { 1 };
10              
11 52     52   2004 has negative => sub { 0 };
12              
13             sub gen_value {
14 54     54 0 115 my $self = shift;
15              
16 54 100       1448 return $self->negative ? 0xe0 - $self->buffer_as_int : $self->buffer_as_int;
17             }
18              
19             1;
20              
21             __END__
22              
23             =pod
24              
25             =encoding UTF-8
26              
27             =head1 NAME
28              
29             MsgPack::Decoder::Generator::FixInt
30              
31             =head1 VERSION
32              
33             version 2.0.2
34              
35             =head1 AUTHOR
36              
37             Yanick Champoux <yanick@cpan.org>
38              
39             =head1 COPYRIGHT AND LICENSE
40              
41             This software is copyright (c) 2019, 2017, 2016, 2015 by Yanick Champoux.
42              
43             This is free software; you can redistribute it and/or modify it under
44             the same terms as the Perl 5 programming language system itself.
45              
46             =cut