blib/lib/Sentry/Envelope.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
serialize
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Sentry::Envelope;
2 use Mojo::Base -base, -signatures;
3  
4 use Mojo::JSON qw(encode_json);
5  
6 has event_id => undef;
7 has headers => sub ($self) { { event_id => $self->event_id } };
8 has body => sub { {} };
9 has sample_rates => sub { [{ id => "client_rate", rate => "1" }] }; # FIXME
10 has type => 'transaction';
11 has item_headers =>
12 sub ($self) { { type => $self->type, sample_rates => $self->sample_rates } };
13  
14 sub serialize ($self) {
15 my @lines = ($self->headers, $self->item_headers, $self->body);
16 return join("\n", map { encode_json($_) } @lines);
17 }
18  
19 1;