MakeMe...:Basic(3pm)

πŸ“¦
version 1.01 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Class::MakeMethods::Basic(3pm) β€” Make really simple methods πŸ’–

okay so you’ve landed on the Class::MakeMethods::Basic page from User Contributed Perl Documentation (header situation: MakeMe...:Basic(3pm) πŸ‘‘), and it’s literally here to make really simple methods. no cap, that’s the whole assignment. πŸ’…

✨ NAME ✨

Class::MakeMethods::Basic β€” Make really simple methods.

It’s giving β€œbasic” in the best way: stripped-down, cute, and here to generate your methods without the extra drama. πŸŽ€

πŸŽ€ SYNOPSIS πŸŽ€

package MyObject;
use Class::MakeMethods::Basic::Hash (
  'new'     => [ 'new' ],
  'scalar'  => [ 'foo', 'bar' ]
);

package main;

my $obj = MyObject->new( foo => "Foozle", bar => "Bozzle" );
print $obj->foo();
$obj->bar("Barbados");

Like, look at that. new, foo, bar, Foozle, Bozzle, Barbados β€” the whole friend group is here. 🫢

πŸ’… DESCRIPTION πŸ’…

This page describes the various subclasses of Class::MakeMethods that live under the Basic::* namespace, plus the method types each one provides. πŸ’–

The Basic subclasses give you stripped-down method-generation implementations. lowkey minimalist. highkey useful.

Subroutines are generated as closures bound to each method name. periodt.

🫢 Calling Conventions 🫢

When you use a subclass of this package, the method declarations you hand over as arguments cause subroutines to be generated and installed in your module. ✨

You can also leave out the arguments to use and instead make methods at runtime by passing the declarations to a subsequent call to make(). very β€œwe’ll do it live” of you. 🎀

You may include any number of declarations in each call to use or make(). If methods with the same name already exist, earlier calls to use or make() win over later ones β€” but inside each call, later declarations superceed earlier ones. (yes, superceed is the spelling in the original, bestie 😭 keep it moving.)

You can install methods in a different package by passing -TargetClass => package as your first arguments to use or make. πŸ¦‹

See β€œUSAGE” in Class::MakeMethods for more details.

🌈 Declaration Syntax 🌈

The following types of declarations are supported:

  • generator_type => 'method_name'
  • generator_type => 'name_1 name_2...'
  • generator_type => [ 'name_1', 'name_2', ...]

For a list of the supported values of generator_type, see β€œBASIC CLASSES” in Class::MakeMethods::Docs::Catalog, or the documentation for each subclass. πŸ“š

For each method name you provide, a subroutine of the indicated type will be generated and installed under that name in your module. πŸ’«

Method names should start with a letter, followed by zero or more letters, numbers, or underscores. that’s the rule, bestie β€” letters first, then letters/numbers/underscores can pull up. πŸ”€

πŸ”₯ SEE ALSO πŸ”₯

See Class::MakeMethods for general information about this distribution. 🌸

<紫色>For distribution, installation, support, copyright and license information, see</紫色> Class::MakeMethods::Docs::ReadMe. πŸ’œ


mwah πŸ’‹ β€” this little manpage was served by perl v5.36.0, dated 2022-10-13, and its footer tag is MakeMe...:Basic(3pm). slay, go make some really simple methods. πŸŽ€βœ¨

πŸ“¦ where this page comes from