/usr/share/perl5/MR/IProto/Response.pm is in libmr-tarantool-perl 0.0.24-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | package MR::IProto::Response;
=head1 NAME
MR::IProto::Response - response message
=head1 DESCRIPTION
Base class for all response messages.
=cut
use Mouse;
extends 'MR::IProto::Message';
=head1 PUBLIC ATTRIBUTES
=over
=item request
Instance of L<MR::IProto::Request>.
=cut
has request => (
is => 'ro',
isa => 'MR::IProto::Request',
required => 1,
);
=back
=head1 PUBLIC METHODS
=over
=item retry
Is request retry must be done.
=cut
sub retry {
return 0;
}
=back
=head1 PROTECTED METHODS
=over
=item BUILDARGS( %args | \%args | $data )
If C<$data> is passed as argument then it unpacked and object is
created based on information contained in it.
See L<Mouse::Manual::Construction/BUILDARGS> for more information.
=cut
around BUILDARGS => sub {
my ($orig, $class, %args) = @_;
if( exists $args{data} ) {
my $parsed_args = $class->_parse_data($args{data});
my $tail = delete $parsed_args->{data};
warn "Not all data was parsed" if defined $tail && length $tail;
return $class->$orig(%$parsed_args, %args);
}
else {
return $class->$orig(%args);
}
};
=item _parse_data( $data )
You B<must> implement this method in you subclass to unpack your object.
Returns hashref of attributes which will be passed to constructor.
=cut
sub _parse_data {
return { data => $_[1] };
}
=back
=cut
no Mouse;
__PACKAGE__->meta->make_immutable();
1;
|