The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Full::Class - common pragmata for modules which provide an OO class

SYNOPSIS

 package Example::Class;
 use Full::Class;

 async method startup {
  $log->infof('Starting %s', __PACKAGE__);
 }

 1;

Method parameter constraints

These use Signature::Attribute::Checked to provide method parameter checks. Note that the extended keyword is required, see Sublike::Extended for more information.

 package Example;
 use Full::Class qw(:v2);
 extended method example ($v :Checked(Num)) { }

Class features

The calling package will be marked as an Object::Pad class, providing the "method" in Object::Pad, "has" in Object::Pad and async method keywords.

This also makes available a Log::Any instance in the $log package variable, and for OpenTelemetry support you get $tracer as an OpenTelemetry instance.

It's very likely that future versions will bring in new functionality or enable/disable a different featureset. This behaviour will be controlled through version tags:

 use Full::Class qw(:v1);

with the default being :v1.

The latest available version is :v2.

AUTHOR

Original code can be found at https://github.com/deriv-com/perl-Myriad/tree/master/lib/Myriad/Class.pm, by Deriv Group Services Ltd. DERIV@cpan.org. This version has been split out as a way to provide similar functionality.

LICENSE

Released under the same terms as Perl itself.