File Coverage

lib/Kafka/Message.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 23 23 100.0


line stmt bran cond sub pod time code
1             package Kafka::Message;
2              
3             =head1 NAME
4              
5             Kafka::Message - Interface to the Kafka message properties.
6              
7             =head1 VERSION
8              
9             This documentation refers to C version 1.06 .
10              
11             =cut
12              
13              
14              
15 6     6   104289 use 5.010;
  6         20  
16 6     6   82 use strict;
  6         12  
  6         128  
17 6     6   29 use warnings;
  6         11  
  6         722  
18              
19              
20              
21             our $VERSION = '1.06';
22              
23              
24              
25              
26              
27             our @_standard_fields = qw(
28             Attributes
29             Timestamp
30             error
31             HighwaterMarkOffset
32             key
33             MagicByte
34             next_offset
35             payload
36             offset
37             valid
38             );
39              
40             #-- constructor ----------------------------------------------------------------
41              
42             sub new {
43 15019     15019 1 27484 my ( $class, $self ) = @_;
44              
45 15019         19336 bless $self, $class;
46              
47 15019         35783 return $self;
48             }
49              
50             #-- public attributes ----------------------------------------------------------
51              
52             {
53 6     6   80 no strict 'refs'; ## no critic
  6         11  
  6         668  
54              
55             # getters
56             foreach my $method ( @_standard_fields )
57             {
58             *{ __PACKAGE__.'::'.$method } = sub {
59 30033     30033   145441 my ( $self ) = @_;
60 30033         63307 return $self->{ $method };
61             };
62             }
63             }
64              
65             #-- public methods -------------------------------------------------------------
66              
67             #-- private attributes ---------------------------------------------------------
68              
69             #-- private methods ------------------------------------------------------------
70              
71              
72              
73             1;
74              
75             __END__