NAME
Kavorka::TraitFor::ReturnType::doc - Document return types in the signature
VERSION
Version 0.1105, released 2021-02-28.
SYNOPSIS
# The class
use Moops;
class My::Class using Moose {
method square(Int $integer --> Int does doc('The squared integer.')) {
return $integer * $integer;
}
}
# Elsewhere
my $return_type = My::Class->meta->get_method('square')->signature->return_types->[0];
say sprintf 'Returns an %s. %s', $return_type->type->name, $return_type->traits->{'doc'}[0];
# says 'Returns an Int. The squared integer.'
DESCRIPTION
Kavorka::TraitFor::ReturnType::doc adds a trait (doc
) that is useful for documenting in Moops classes created using Moose.
SEE ALSO
SOURCE
https://github.com/Csson/p5-Kavorka-TraitFor-Parameter-doc
HOMEPAGE
https://metacpan.org/release/Kavorka-TraitFor-Parameter-doc
AUTHOR
Erik Carlsson <info@code301.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.