Movatterモバイル変換


[0]ホーム

URL:


 / 
Moose-2.2207
River stage four • 2954 direct dependents • 3974 total dependents
/Class::MOP::Overload

NAME

Class::MOP::Overload - Overload Meta Object

VERSION

version 2.2207

SYNOPSIS

my $meta     = Class->meta;my $overload = $meta->get_overloaded_operator('+');if ( $overload->has_method_name ) {    print 'Method for + is ', $overload->method_name, "\n";}else {    print 'Overloading for + is implemented by ',        $overload->coderef_name, " sub\n";}

DESCRIPTION

This class provides meta information for overloading in classes and roles.

INHERITANCE

Class::MOP::Overload is a subclass ofClass::MOP::Object.

METHODS

Class::MOP::Overload->new(%options)

This method creates a newClass::MOP::Overload object. It accepts a number of options:

  • operator

    This is a string that matches an operator known by theoverload module, such as"" or+. This is required.

  • method_name

    The name of the method which implements the overloading. Note that this does not need to actually correspond to a real method, since it's okay to declare a not-yet-implemented overloading.

    Either this or thecoderef option must be passed.

  • method

    AClass::MOP::Method object for the method which implements the overloading.

    This is optional.

  • coderef

    A coderef which implements the overloading.

    Either this or themethod_name option must be passed.

  • coderef_package

    The package where the coderef was defined.

    This is required ifcoderef is passed.

  • coderef_name

    The name of the coderef. This can be "__ANON__".

    This is required ifcoderef is passed.

  • associated_metaclass

    AClass::MOP::Module object for the associated class or role.

    This is optional.

$overload->operator

Returns the operator for this overload object.

$overload->method_name

Returns the method name that implements overloading, if it has one.

$overload->has_method_name

Returns true if the object has a method name.

$overload->method

Returns theClass::MOP::Method that implements overloading, if it has one.

$overload->has_method

Returns true if the object has a method.

$overload->coderef

Returns the coderef that implements overloading, if it has one.

$overload->has_coderef

Returns true if the object has a coderef.

$overload->coderef_package

Returns the package for the coderef that implements overloading, if it has one.

$overload->has_coderef

Returns true if the object has a coderef package.

$overload->coderef_name

Returns the sub name for the coderef that implements overloading, if it has one.

$overload->has_coderef_name

Returns true if the object has a coderef name.

$overload->is_anonymous

Returns true if the overloading is implemented by an anonymous coderef.

$overload->associated_metaclass

Returns theClass::MOP::Module (class or role) that is associated with the overload object.

$overload->clone

Clones the overloading object, settingoriginal_overload in the process.

$overload->original_overload

For cloned objects, this returns theClass::MOP::Overload object from which they were cloned. This can be used to determine the source of an overloading in a class that came from a role, for example.

AUTHORS

  • Stevan Little <stevan@cpan.org>

  • Dave Rolsky <autarch@urth.org>

  • Jesse Luehrs <doy@cpan.org>

  • Shawn M Moore <sartak@cpan.org>

  • יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>

  • Karen Etheridge <ether@cpan.org>

  • Florian Ragwitz <rafl@debian.org>

  • Hans Dieter Pearcey <hdp@cpan.org>

  • Chris Prather <chris@prather.org>

  • Matt S Trout <mstrout@cpan.org>

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.

Module Install Instructions

To install Moose, copy and paste the appropriate command in to your terminal.

cpanm

cpanm Moose

CPAN shell

perl -MCPAN -e shellinstall Moose

For more information on module installation, please visitthe detailed CPAN module installation guide.

Keyboard Shortcuts

Global
sFocus search bar
?Bring up this help dialog
GitHub
gpGo to pull requests
gigo to github issues (only if github is preferred repository)
POD
gaGo to author
gcGo to changes
giGo to issues
gdGo to dist
grGo to repository/SCM
gsGo to source
gbGo to file browse
Search terms
module: (e.g.module:Plugin)
distribution: (e.g.distribution:Dancer auth)
author: (e.g.author:SONGMU Redis)
version: (e.g.version:1.00)

[8]ページ先頭

©2009-2025 Movatter.jp