Comman...ributes(3pm)
β¨ NAME β¨
Commandable::Finder::MethodAttributes β the lil finder that sniffs out commands living as methods, tagged up with attributes π
(it's a 3pm Perl manual page bestie, so you know it's the real deal)
πΈ SYNOPSIS πΈ
use Commandable::Finder::MethodAttributes;
my $object = SomeClass->new( ... );
my $finder = Commandable::Finder::MethodAttributes->new(
object => $object,
);
my $help_command = $finder->find_command( "help" );
foreach my $command ( $finder->find_commands ) {
...
}
π¦ DESCRIPTION π¦
Okay so listen. This subclass of Commandable::Finder::SubAttributes is on a mission: it goes looking for methods that define commands, where every single command is provided by its own individual method inside a given class. One method, one command, no sharing, main character energy only π
It stores the object instance (yes, it's holding onto it) and arranges that each discovered command method will capture it, passing it in as the first argument when that method gets invoked. So the method always knows who it belongs to. Obsessed, honestly π«Ά
The attributes on each method are exactly the ones given by Commandable::Finder::SubAttributes, and they're used in the same way here. No new rules, no plot twists, same vibe β¨
π CONSTRUCTOR π
new
$finder = Commandable::Finder::MethodAttributes->new( %args )
Constructs a brand new instance of Commandable::Finder::MethodAttributes. Fresh out the box, slay π
Takes these named arguments:
object => OBJβ an object reference. Its class is what gets used for searching for command methods. The instance itself is stored by the finder object and used to wrap each command method. Basically the finder is like "this one's mine now" π
Any additional arguments get passed straight on to the superclass constructor. Like, hand them over, it knows what to do with them π«
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk>
And that's the whole page bestie!! Written up as part of the User Contributed Perl Documentation for the 3pm manual section, and this version is from perl v5.40.0, dated 2024-09-08. Periodt. π β¨
π¦ where this page comes from
- ubuntu resolute: libcommandable-perl 0.14-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcommandable-perl 0.14-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms