{"id":7178,"date":"2022-12-20T19:35:44","date_gmt":"2022-12-20T22:35:44","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/classmopmethod-man3\/"},"modified":"2022-12-20T19:35:44","modified_gmt":"2022-12-20T22:35:44","slug":"classmopmethod-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/classmopmethod-man3\/","title":{"rendered":"Class::MOP::Method (man3)"},"content":{"rendered":"<h1 align=\"center\">Class::MOP::Method<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#VERSION\">VERSION<\/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 \u2212 Method Meta Object<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">version 2.2014<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The Method Protocol is very small, since methods in Perl 5 are just subroutines in a specific package. We provide a very basic introspection interface.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Class::MOP::Method\u2212>wrap($code, %options)<\/b><\/p>\n<p style=\"margin-left:17%;\">This is the constructor. It accepts a method body in the form of either a code reference or a Class::MOP::Method instance, followed by a hash of options.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The options are:<\/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=\"11%\"><\/td>\n<td width=\"6%\">\n<p>name<\/p>\n<\/td>\n<td width=\"65%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:29%; margin-top: 1em\">The method name (without a package name). This is required if $code is a coderef.<\/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=\"11%\"><\/td>\n<td width=\"19%\">\n<p style=\"margin-top: 1em\">package_name<\/p>\n<\/td>\n<td width=\"52%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:29%; margin-top: 1em\">The package name for the method. This is required if $code is a coderef.<\/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=\"11%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\">associated_metaclass<\/p>\n<\/td>\n<td width=\"40%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:29%; margin-top: 1em\">An optional Class::MOP::Class object. This is the metaclass for the method\u2019s class.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>clone(%params)<\/b><\/p>\n<p style=\"margin-left:17%;\">This makes a shallow clone of the method object. In particular, subroutine reference itself is shared between all clones of a given method.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">When a method is cloned, the original method object will be available by calling &#8220;original_method&#8221; on the clone.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>body<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns a reference to the method\u2019s subroutine.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s name.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>package_name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s package name.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>fully_qualified_name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s fully qualified name (package name and method name).<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>associated_metaclass<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the Class::MOP::Class object for the method, if one exists.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>original_method<\/b><\/p>\n<p style=\"margin-left:17%;\">If this method object was created as a clone of some other method object, this returns the object that was cloned.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>original_name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s original name, wherever it was first defined.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If this method is a clone of a clone (of a clone, etc.), this method returns the name from the <i>first<\/i> method in the chain of clones.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>original_package_name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s original package name, wherever it was first defined.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If this method is a clone of a clone (of a clone, etc.), this method returns the package name from the <i>first<\/i> method in the chain of clones.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>original_fully_qualified_name<\/b><\/p>\n<p style=\"margin-left:17%;\">This returns the method\u2019s original fully qualified name, wherever it was first defined.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If this method is a clone of a clone (of a clone, etc.), this method returns the fully qualified name from the <i>first<\/i> method in the chain of clones.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>is_stub<\/b><\/p>\n<p style=\"margin-left:17%;\">Returns true if the method is just a stub:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">sub foo;<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>attach_to_class($metaclass)<\/b><\/p>\n<p style=\"margin-left:17%;\">Given a Class::MOP::Class object, this method sets the associated metaclass for the method. This will overwrite any existing associated metaclass.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>detach_from_class<\/b><\/p>\n<p style=\"margin-left:17%;\">Removes any associated metaclass object for the method.<\/p>\n<p style=\"margin-left:11%;\"><b>$metamethod\u2212>execute(&#8230;)<\/b><\/p>\n<p style=\"margin-left:17%;\">This executes the method. Any arguments provided will be passed on to the method itself.<\/p>\n<p style=\"margin-left:11%;\"><b>Class::MOP::Method\u2212>meta<\/b><\/p>\n<p style=\"margin-left:17%;\">This will return a Class::MOP::Class instance for this class.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">It should also be noted that Class::MOP will actually bootstrap this module by installing a number of attribute meta-objects into its metaclass.<\/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 \u2212 Method Meta Object <\/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":[3510,3007],"class_list":["post-7178","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-classmopmethod","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7178","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=7178"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7178\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}