s://metacpan.org/pod/WebService::Raygun'
};
}
=head2 prepare_raygun
Converts a Perl hash to JSON.
=cut
sub prepare_raygun {
my $self = shift;
my $formatter = DateTime::Format::Str
=> sub {
return '';
},
);
=head2 prepare_raygun
Prepare the data for conversion to JSON.
=cut
sub prepare_raygun {
my $self = shift;
return {
lineNumber => $self->line
return [];
},
);
=head2 prepare_raygun
Prepare the error structure to be converted to JSON and sent to raygun.io.
=cut
sub prepare_raygun {
my $self = shift;
return {
inn
aygun> method may be called to retreive the structure in a form
that can be converted directly to JSON.
=head1 INTERFACE
=cut
use Data::GUID 'guid_string';
use Mouse::Util::TypeConstraints;
subt
aygun> method may be called to retreive the structure in a form
that can be converted directly to JSON.
=head1 INTERFACE
=cut
use Filesys::DfPortable;
use Sys::Info;
use Sys::Info::OS;
use POSIX (
C<RAYGUN_API_KEY> environment variable.
=cut
use LWP::UserAgent;
use URI;
use Mozilla::CA;
use JSON;
use WebService::Raygun::Message;
has api_key => (
is => 'rw',
isa => 'Str',
$ua = $self->user_agent;
my $json = JSON->new->allow_nonref;
my $jsoned = $json->pretty->encode( $message->prepare_raygun );
### json : $jsoned
my $req = HTTP::Request->new( P
req->header( 'Content-Type' => 'application/json' );
$req->header( 'X-ApiKey' => $api_key );
$req->content($jsoned);
### json message : $jsoned;
my $response = $ua->request($req);