info > Class::MOP::Method::Accessor

๐Ÿ“ NAME

Class::MOP::Method::Accessor - Method Meta Object for accessors

๐Ÿš€ Quick Reference

Use Case Command Description
๐Ÿ“– Create a reader accessor Class::MOP::Method::Accessor->new(attribute => $attr, accessor_type => 'reader') Generate a read-only accessor for an attribute
โœ๏ธ Create a writer accessor ... accessor_type => 'writer' Generate a write-only accessor
๐Ÿ”„ Create a read/write accessor ... accessor_type => 'accessor' Generate a combined reader/writer
โ“ Create a predicate ... accessor_type => 'predicate' Generate a boolean check for attribute existence
๐Ÿงน Create a clearer ... accessor_type => 'clearer' Generate a method to clear attribute value
๐Ÿท๏ธ Check accessor type $metamethod->accessor_type Get the type of accessor ('reader', 'writer', etc.)
๐Ÿ”ง Check if inlined $metamethod->is_inline Returns boolean if method is inlined
๐Ÿ“ฆ Get associated attribute $metamethod->associated_attribute Retrieve the Class::MOP::Attribute object
โšก Execute the generated method $metamethod->body->execute($instance) Call the accessor method on an instance

๐Ÿ“ฆ VERSION

version 2.2200

๐Ÿ’ป SYNOPSIS

use Class::MOP::Method::Accessor;

my $reader = Class::MOP::Method::Accessor->new(
    attribute     => $attribute,
    is_inline     => 1,
    accessor_type => 'reader',
);

$reader->body->execute($instance); # call the reader method

๐Ÿ“– DESCRIPTION

This is a subclass of Class::MOP::Method which is used by Class::MOP::Attribute to generate accessor code. It handles generation of readers, writers, predicates and clearers. For each type of method, it can either create a subroutine reference, or actually inline code by generating a string and eval'ing it.

๐Ÿ”ง METHODS

๐Ÿ‘ฅ AUTHORS

๐Ÿ“„ COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Infinity Interactive, Inc.

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

perl v5.34.0 2022-02-06 Class::MOP::Method::Accessor(3pm)

Class::MOP::Method::Accessor
๐Ÿ“ NAME ๐Ÿš€ Quick Reference ๐Ÿ“ฆ VERSION ๐Ÿ’ป SYNOPSIS ๐Ÿ“– DESCRIPTION ๐Ÿ”ง METHODS ๐Ÿ‘ฅ AUTHORS ๐Ÿ“„ COPYRIGHT AND LICENSE

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-26 05:55 @216.73.217.127
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!