MooseX...Method(3pm)

πŸ“¦
version 0.004 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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>


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