NAME
Mite::Manual::Features - other features provided by Mite
MANUAL
Class Methods
Your class can or will provide the following methods:
new( %attributes )
or new( \%attributes )
Constructor for your class. It takes some arguments and returns an object.
Mite generates this for you.
Mite automatically provides a similar feature to MooseX::StrictConstructor, so your constructor will die if you pass it unknown attributes.
BUILDARGS
Works as in Moose and allows your constructor to be called with something other than a hash of attributes. Mite does not generate this for you.
FOREIGNBUILDARGS
Works as in Moo and MooseX::NonMoose. Mite does not generate this for you.
BUILD
/ BUILDALL
.
Works as in Moose. Mite generates BUILDALL
for you.
DEMOLISH
/ DESTROY
Works as in Moose. Mite generates DESTROY
for you.
On Perl older than 5.14, the $in_global_destruction
argument will be undefined unless Devel::GlobalDestruction is installed, so add that to your project's dependencies if you are relying on it and need to support older versions of Perl.
DOES
/ does
DOES
allows you to check if your class/object performs a particular role. See UNIVERSAL.
does
is just an alias.
If you want to fake support for a role:
$Your::Project::SomeClass::DOES{'Your::Project::SomeRole'} = 1;
strict
Mite will turn strict on for you.
warnings
Mite will turn warnings on for you.
Clean Classes
Mite will automatically import namespace::autoclean into your classes if it is installed on the end user's system. If it's not available, your classes will quietly be left with imported keywords cluttering up their namespace.
To force namespace::autoclean, then just use it manually:
use Your::Project::Mite;
use namespace::autoclean;
To force it to not be used:
use Your::Project::Mite qw( -unclean );
BUGS
Please report any bugs to https://github.com/tobyink/p5-mite/issues.
AUTHOR
Michael G Schwern <mschwern@cpan.org>.
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2011-2014 by Michael G Schwern.
This software is copyright (c) 2022 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.