logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Mu::Tiny - NAE KING! NAE QUIN! NAE CAPTAIN! WE WILLNAE BE FOOLED AGAIN!

Apologies

       ... to Terry Pratchett, Mithaldu, and probably everybody else as well.

Author

        mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>

Contributors

       None yet - maybe this software is perfect! (ahahahahahahahahaha)

Description

       This is the aaaabsoluuuute baaaaare minimumimumimum subset o' Mu, for those o' ye who value yer
       independence over yer sanity. It doesnae trouble wi' anythin' but the read-onlies, for tis a terrible
       thing to make a feegle try t' write.

Exports

ro
         ro 'attr';

       An "ro" attr be required and read only, and knows nothin' but its own name.

   lazy
         lazy 'attr' => sub { <build default value> };

       A "lazy" attr be read only but not required, an' if ye make us, we'll take a guess at what ye wanted, but
       only when we must.

       If'n ye be slightly less lazy than us, then subclass and override yan "_build_attr" method t' change tha
       guess.

License

       This library is free software and may be distributed under the same terms as perl itself.

perl v5.36.0                                       2022-10-13                                      Mu::Tiny(3pm)

Methods

new
         my $new = Feegle->new(%attrs|\%attrs);

       The new method be inherited from "Mu::Tiny::Object" like a shiny thing or the duties o' a Kelda.

       Ye may hand it a hash, or if ye already made yer own hash o' things, a reference to the one so pre-
       prepared.

       An ye forget any o' the attrs declared as "ro", then "new" will go waily waily waily and "croak" with a
       list of all that ye missed.

Name

       Mu::Tiny - NAE KING! NAE QUIN! NAE CAPTAIN! WE WILLNAE BE FOOLED AGAIN!

Synopsis

         BEGIN {
           package Feegle;

           use Mu::Tiny;

           ro 'name';
           lazy plan => sub { 'PLN' };
         }

         my $rob = Feegle->new(name => 'Rob Anybody'); # name is required

         say $rob->plan; # outputs 'PLN'

Whut

       Dinnae fash yersel', Hamish, you prob'ly wanted Mu anyway.

See Also