{"id":6631,"date":"2022-12-20T19:19:28","date_gmt":"2022-12-20T22:19:28","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/classmopmethodaccessor-man3\/"},"modified":"2022-12-20T19:19:28","modified_gmt":"2022-12-20T22:19:28","slug":"classmopmethodaccessor-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/classmopmethodaccessor-man3\/","title":{"rendered":"Class::MOP::Method::Accessor (man3)"},"content":{"rendered":"<h1 align=\"center\">Class::MOP::Method::Accessor<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#VERSION\">VERSION<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#COPYRIGHT AND LICENSE\">COPYRIGHT AND LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Class::MOP::Method::Accessor \u2212 Method Meta Object for accessors<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">version 2.2014<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Class::MOP::Method::Accessor; <br \/> my $reader = Class::MOP::Method::Accessor\u2212>new( <br \/> attribute => $attribute, <br \/> is_inline => 1, <br \/> accessor_type => &#8216;reader&#8217;, <br \/> ); <br \/> $reader\u2212>body\u2212>execute($instance); # call the reader method<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This is a subclass of &#8220;Class::MOP::Method&#8221; which is used by &#8220;Class::MOP::Attribute&#8221; 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 &#8220;eval&#8221;\u2019ing it.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Class::MOP::Method::Accessor\u2212>new(%options)<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns a new &#8220;Class::MOP::Method::Accessor&#8221; based on the %options provided.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"14%\">\n<p>attribute<\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">This is the &#8220;Class::MOP::Attribute&#8221; for which accessors are being generated. This option is required.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"20%\">\n<p style=\"margin-top: 1em\">accessor_type<\/p>\n<\/td>\n<td width=\"57%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">This is a string which should be one of &#8220;reader&#8221;, &#8220;writer&#8221;, &#8220;accessor&#8221;, &#8220;predicate&#8221;, or &#8220;clearer&#8221;. This is the type of method being generated. This option is required.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"14%\">\n<p style=\"margin-top: 1em\">is_inline<\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">This indicates whether or not the accessor should be inlined. This defaults to false.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"6%\">\n<p style=\"margin-top: 1em\">name<\/p>\n<\/td>\n<td width=\"71%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">The method name (without a package name). This is required.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"19%\">\n<p style=\"margin-top: 1em\">package_name<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:23%; margin-top: 1em\">The package name for the method. This is required.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>accessor_type<\/b><\/p>\n<p style=\"margin-left:17%;\">Returns the accessor type which was passed to &#8220;new&#8221;.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>is_inline<\/b><\/p>\n<p style=\"margin-left:17%;\">Returns a boolean indicating whether or not the accessor is inlined.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>associated_attribute<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the Class::MOP::Attribute object which was passed to &#8220;new&#8221;.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>body<\/b><\/p>\n<p style=\"margin-left:17%;\">The method itself is <i>generated<\/i> when the accessor object is constructed.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">Stevan Little <stevan@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Dave Rolsky <autarch@urth.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Jesse Luehrs <doy@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Shawn M Moore <sartak@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>\u00d7\u00d7\u00d7\u00d7 \u00d7\u00a7\u00d7\u00d7\u2019\u00d7\u00d7 (Yuval Kogman) <nothingmuch@woobling.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Karen Etheridge <ether@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Florian Ragwitz <rafl@debian.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Hans Dieter Pearcey <hdp@cpan.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Chris Prather <chris@prather.org><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>Matt S Trout <mstrout@cpan.org><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>COPYRIGHT AND LICENSE <a name=\"COPYRIGHT AND LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This software is copyright (c) 2006 by Infinity Interactive, Inc.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This is free software; you can redistribute it and\/or modify it under the same terms as the Perl 5 programming language system itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Class::MOP::Method::Accessor \u2212 Method Meta Object for accessors <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3012,3007],"class_list":["post-6631","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-classmopmethodaccessor","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6631"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6631\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}