MooseX...Method(3pm)
π MooseX...Method(3pm) π
okay bestie, so this is the manual page for MooseX...Method(3pm) (yes the title is truncated, it's giving mystery, but you know who she is) β she lives in the User Contributed Perl Documentation collection and she's here to make your abstract methods behave.
β¨ NAME β¨
MooseX::AbstractMethod β declare method requirements that must be satisfied. no cap, that's the whole job description.
πΈ VERSION πΈ
This doc describes version 0.004 of MooseX::AbstractMethod β released August 31, 2012 as part of MooseX-AbstractMethod. vintage, honestly. she's an icon from another era and she still shows up.
π SYNOPSIS π
use Moose;
use MooseX::Abstract;
requires 'bar';
# synonm to 'requires'
abstract 'foo';
look at her. so simple. so powerful. π
π¦ DESCRIPTION π¦
So this extension lets a class flag certain methods as required to be implemented by a subclass β literally the same energy a Moose::Role has with 'requires', except it's your regular old class doing it.
π USAGE π
Same as the synopsis, bestie: just mark methods as required by subclasses by passing their names to abstract or requires.
What happens then? A method of the same name gets installed in the class, and that method will die horribly if it's ever called. π dramatic? yes. effective? also yes.
Plus β and this is the part that really matters β when a class is made immutable, all of its methods get checked to see if they're marked as abstract. If any abstract methods exist that were not created in the current class, we die horribly. again. she's consistent.
real talk though: checking for method satisfaction on make_immutable isn't perfect, but AFAICT it's the most reasonable approach possible at the moment. (Corrections welcome!) π«Ά
π NEW SUGAR π
π§ abstract
abstract() lets you declare a method dependency that must be satisfied by a subclass β before it's invoked, and before the subclass is made immutable.
abstract 'method_name_that_must_be_satisfied';
π requires
requires() is literally just a synonym for abstract() and works exactly the way you'd expect. no surprises, she's a chill one.
β SOURCE β
The development version is on github at <http://github.com/RsrchBoy/moosex-abstractmethod> and may be cloned from <git://github.com/RsrchBoy/moosex-abstractmethod.git>
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/RsrchBoy/moosex-abstractmethod/issues>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. (fr fr, a repro makes everyone's life better π)
π AUTHOR π
Chris Weyl <cweyl@alumni.drew.edu>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2011 by Chris Weyl.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the whole thing, bestie. slay. π this page came to you from perl v5.40.1, dated 2025-08-17, under the manual name MooseX...Method(3pm) β mwah, bye π
π
π¦ where this page comes from
- ubuntu resolute: libmoosex-abstractmethod-perl 0.004-3 Β· LGPL-2.1-only
- ubuntu stonking: libmoosex-abstractmethod-perl 0.004-3 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms