Mason:...lation(3pm)

πŸ“¦
version 2.24 Β· 2 versions
  • 2.24 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.24 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 as bad_attribute_names above, 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, $m and other required pieces. by default it consults the class_header parameter. πŸ¦‹

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. $coderef is a reference to a string containing the code; the method can modify the code as desired. see Mason::Plugin::DollarDot for 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 🌸


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