:Location->new(
line => 12, column => 26
);
my $loc_json = $loc->to_json;
my $envelope = Cucumber::Messages::Envelope->from_json($serialized_envelope);
=head1 DESCRIPTION
L<Cucumber mess
various
components communicate. Messages are serialized to NDJSON.
This library provides both serialization/deserialization to/from NDJSON as
well as the in-memory representation of the messages for
rapped in a C<Cucumber::Messages::Envelope>
and can thereby be deserialized by calling the C<from_json> class message
with the serialized representation as its argument, like shown in the SYNOPSIS.
=
s::Message';
has 'prop1';
has 'prop2';
=head1 DESCRIPTION
=cut
use Carp qw(croak);
use JSON::MaybeXS;
use Scalar::Util qw( blessed );
use Moo;
# 'use Moo' implies 'use strict; use warning
ncy tree for the Cucumber::Messages
# library, I decided to go for Moo instead of Moose.
my $json = JSON::MaybeXS->new(
utf8 => 0, pretty => 0, indent => 0, canonical => 1
);
sub _camelize
? JSON::MaybeXS->true : JSON::MaybeXS->false;
}
}
}
sub _from_hash {
my ($value, %args) = @_;
if (my $ref = ref $value) {
return $value ? 1 : ''
if $json->i