Mouse:...:Class(3pm)

🌸 NAME 🌸

Mouse::Meta::Class β€” The Mouse class metaclass. This page is Mouse:...:Class(3pm) from the User Contributed Perl Documentation, and we're about to vibe through it together, bestie. πŸ’–

✨ VERSION ✨

This document describes Mouse version v2.6.2, periodt. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

This class is a meta object protocol for Mouse classes, which is a subset of Moose::Meta:::Class. Yes, literally that exact spelling β€” we keep the details flawless around here. πŸ’…

🧚 METHODS 🧚

  • initialize(ClassName) -> Mouse::Meta::Class β€” finds or creates a Mouse::Meta::Class instance for the given ClassName. Only one instance should exist for a given class, okay? πŸ‘‘
  • name -> ClassName β€” returns the name of the owner class. Main character energy, obviously. ⭐
  • superclasses -> ClassNames / superclass(ClassNames) β€” gets (or sets) the list of superclasses of the owner class. πŸŒ€
  • add_method(name => CodeRef) β€” adds a method to the owner class. Slay. πŸŽ€
  • has_method(name) -> Bool β€” returns whether we have a method with the given name. A little vibe check for methods. βœ…
  • get_method(name) -> Mouse::Meta::Method | undef β€” returns a Mouse::Meta::Method with the given name. Note that you can also use $metaclass->name->can($name) for a method body. iykyk πŸ’«
  • get_method_list -> Names β€” returns a list of method names which are defined in the local class. If you want a list of all applicable methods for a class, use the get_all_methods method. πŸ”₯
  • get_all_methods -> (Mouse::Meta::Method) β€” returns the list of all Mouse::Meta::Method instances associated with the class and its superclasses. The whole squad. πŸ‘―
  • add_attribute(name => spec | Mouse::Meta::Attribute) β€” begins keeping track of the existing Mouse::Meta::Attribute for the owner class. 🌈
  • has_attribute(Name) -> Bool β€” returns whether we have a Mouse::Meta::Attribute with the given name. Attribute vibe check: passed or not? πŸ“
  • get_attribute Name -> Mouse::Meta::Attribute | undef β€” returns the Mouse::Meta::Attribute with the given name. 🧺
  • get_attribute_list -> Names β€” returns a list of attribute names which are defined in the local class. If you want a list of all applicable attributes for a class, use the get_all_attributes method. πŸ’œ
  • get_all_attributes -> (Mouse::Meta::Attribute) β€” returns the list of all Mouse::Meta::Attribute instances associated with this class and its superclasses. Iconic inheritance behavior. πŸ‘‘
  • linearized_isa -> [ClassNames] β€” returns the list of classes in method dispatch order, with duplicates removed. No repeats, no skips, just the lineup. 🎢
  • new_object(Parameters) -> Instance β€” creates a new instance. Fresh out the box. 🎁
  • clone_object(Instance, Parameters) -> Instance β€” clones the given instance which must be an instance governed by this metaclass. Copy-paste but make it legal, bestie. 😭
  • throw_error(Message, Parameters) β€” throws an error with the given message. Dramatic? Maybe. But accurate. πŸ’€

🌟 SEE ALSO 🌟

  • Mouse::Meta::Module
  • Moose::Meta::Class
  • Class::MOP::Class

Signed, sealed, and delivered by perl v5.42.2 on 2026-04-21, and this lil page is Mouse:...:Class(3pm) πŸ’…βœ¨

πŸ“¦ where this page comes from