MooseX...tructor(3pm)

πŸ“¦
version 0.27 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’… MooseX::NonMoose::Meta::Role::Constructor β€” the manual page, bestie edition

okay so you're looking at MooseX...tructor(3pm) from the User Contributed Perl Documentation, and the full glow-up name is MooseX::NonMoose::Meta::Role::Constructor β€” it's the constructor method trait for MooseX::NonMoose. yes ma'am. πŸŽ€


✨ NAME ✨

MooseX::NonMoose::Meta::Role::Constructor β€” constructor method trait for MooseX::NonMoose. that's the whole name section, short and iconic, we love a concise queen πŸ‘‘


πŸ¦‹ VERSION πŸ¦‹

version 0.27 β€” that's the one, no cap.


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, copied exactly, character for character, because we do NOT mess with code in this house:

package My::Moose;
use Moose ();
use Moose::Exporter;

Moose::Exporter->setup_import_methods;
sub init_meta {
    shift;
    my %options = @_;
    Moose->init_meta(%options);
    Moose::Util::MetaRole::apply_metaclass_roles(
        for_class               => $options{for_class},
        metaclass_roles         => ['MooseX::NonMoose::Meta::Role::Class'],
        constructor_class_roles =>
            ['MooseX::NonMoose::Meta::Role::Constructor'],
    );
    return Moose::Util::find_meta($options{for_class});
}

like… look at her go. she's setting up an exporter, running init_meta, and applying metaclass roles via Moose::Util::MetaRole::apply_metaclass_roles β€” with for_class set to $options{for_class}, metaclass_roles set to ['MooseX::NonMoose::Meta::Role::Class'], and constructor_class_roles set to ['MooseX::NonMoose::Meta::Role::Constructor']. then she returns Moose::Util::find_meta($options{for_class}). periodt. πŸ’…


🌈 DESCRIPTION 🌈

so basically, this trait implements inlining of the constructor for classes that are using the MooseX::NonMoose::Meta::Role::Class metaclass trait.

🚨 IMPORTANT BESTIE ALERT 🚨 β€” this trait has no effect unless that trait is also used. it's a duo. a package deal. a two-piece. if MooseX::NonMoose::Meta::Role::Class isn't in the mix, this one is just… sitting there, doing nothing, minding its business. 😭

for the full tea, go read those docs and the docs for MooseX::NonMoose. they said it, not me. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

  • Original author: Jesse Luehrs <doy@tozt.net>
  • Current maintainer: Graham Ollis <plicease@cpan.org>

two icons, one legacy. we stan. πŸ’–


This software is copyright (c) 2009-2025 by Jesse Luehrs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


πŸŽ€ SEE ALSO πŸŽ€

ngl the original page didn't hand me a SEE ALSO section, so there's nothing extra to list here β€” but the DESCRIPTION does point you at the docs for the MooseX::NonMoose::Meta::Role::Class metaclass trait and the docs for MooseX::NonMoose, so those are your reading list, bestie. πŸ“šβœ¨


and that's the whole page!! mwah πŸ’‹ this was generated by perl v5.40.0 on 2025-01-11, and it lives in the User Contributed Perl Documentation as MooseX...tructor(3pm). thanks for reading, go inline a constructor, slay responsibly. πŸ¦‹πŸ’–πŸŒΈ

πŸ“¦ where this page comes from