Mason:...lation(3pm)
π Mason::Compilation β the whole vibe π
okay so bestie, welcome to Mason::Compilation (manual page Mason:...lation(3pm), she's a User Contributed Perl Documentation girlie) β she does the compilation of a single component. one component. that's her whole job. iconic. π
β¨ NAME β¨
Mason::Compilation β Performs compilation of a single component π
π¦ DESCRIPTION π¦
so here's the tea: a brand new Mason::Compilation object gets created by Mason::Interp to compile each component. every single one. she shows up, compiles, no drama. π«Ά
and then β okay don't be sad β this class has no public API at this time. that's it. that's the whole thing. she's mysterious. she's lowkey booked and busy internally. π
π MODIFIABLE METHODS π
these methods are not intended to be called externally, bestie, i'm gonna say that again for the people in the back β not meant to be called from the outside. but they may be useful to modify with method modifiers in plugins and subclasses. and their APIs will be kept as stable as possible. so like, you can touch them, just respectfully. π
bad_attribute_names ()β an arrayref-style list of attribute names that should not be used because they're reserved for built-in attributes or methods:"args","m","cmeta","render","main", etc. don't use them, fr fr, they're taken.bad_method_names ()β a list of method names that should not be used because they're reserved for built-in attributes:"args","m","cmeta", etc. she's not as extensive asbad_attribute_namesabove, and here's why: methods like"render"and"main"can be overridden β but they make absolutely no sense as attributes. so it's giving "different list, different rules". πcompile ()β the top-level method called to compile the component. returns the generated component class. she's the main character, honestly. πnamed_block_types ()β an arrayref of valid named block types:"after","filter","method", etc. add to this list if you want to create your own named blocks (i.e. blocks that take a name argument). make your own, bestie, i believe in you. πΈoutput_class_footer ()β Perl code to be added at the bottom of the class. empty by default. nothing there. a blank canvas. β¨output_class_header ()β Perl code to be added at the top of the class, just after initialization of Moose,$mand other required pieces. by default it consults theclass_headerparameter. π¦
like, for example, if you wanted to add to the top of every component class:
# Add to the top of every component class:
# use Modern::Perl;
# use JSON::XS qw(encode_json decode_json);
#
override 'output_class_header' => sub {
return join( "\n",
super(),
'use Modern::Perl;',
'use JSON::XS qw(encode_json decode_json);' );
};
look at her go. so clean. so slay. π
process_perl_code ($coderef)β this method is called on each distinct piece of Perl code in the component.$coderefis a reference to a string containing the code; the method can modify the code as desired. seeMason::Plugin::DollarDotfor a sample usage. iykyk. π₯unnamed_block_types ()β an arrayref of valid unnamed block types:"args","class","init", etc. add to this list if you want to create your own unnamed blocks. β¨valid_flags ()β an arrayref of valid flags: contains only"extends"at time of writing. add to this list if you want to create your own flags. π
π SEE ALSO π
Masonβ the mothership, the blueprint, the whole ecosystem π
π«Ά AUTHOR π«Ά
Jonathan Swartz <swartz@pobox.com> β thank you king, we appreciate you πΈ
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2012 by Jonathan Swartz.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in go off, bestie, remix it. π¦
and that's the whole page, no cap. perl v5.34.0, dated 2022-05-27, from the manual page Mason:...lation(3pm) β she said what she said, and she ate. periodt. π
β¨π
π¦ where this page comes from
- debian bookworm: libmason-perl 2.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmason-perl 2.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmason-perl 2.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmason-perl 2.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmason-perl 2.24-2 Β· 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