<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
package Class::MOP::Method::Generated;
BEGIN {
  $Class::MOP::Method::Generated::AUTHORITY = 'cpan:STEVAN';
}
{
  $Class::MOP::Method::Generated::VERSION = '2.0603';
}

use strict;
use warnings;

use Carp 'confess';
use Eval::Closure;

use base 'Class::MOP::Method';

## accessors

sub new {
    confess __PACKAGE__ . " is an abstract base class, you must provide a constructor.";
}

sub _initialize_body {
    confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
}

sub _generate_description {
    my ( $self, $context ) = @_;
    $context ||= $self-&gt;definition_context;

    my $desc = "generated method";
    my $origin = "unknown origin";

    if (defined $context) {
        if (defined $context-&gt;{description}) {
            $desc = $context-&gt;{description};
        }

        if (defined $context-&gt;{file} || defined $context-&gt;{line}) {
            $origin = "defined at "
                    . (defined $context-&gt;{file}
                        ? $context-&gt;{file} : "&lt;unknown file&gt;")
                    . " line "
                    . (defined $context-&gt;{line}
                        ? $context-&gt;{line} : "&lt;unknown line&gt;");
        }
    }

    return "$desc ($origin)";
}

sub _compile_code {
    my ( $self, @args ) = @_;
    unshift @args, 'source' if @args % 2;
    my %args = @args;

    my $context = delete $args{context};
    my $environment = $self-&gt;can('_eval_environment')
        ? $self-&gt;_eval_environment
        : {};

    return eval_closure(
        environment =&gt; $environment,
        description =&gt; $self-&gt;_generate_description($context),
        %args,
    );
}

1;

# ABSTRACT: Abstract base class for generated methods



=pod

=head1 NAME

Class::MOP::Method::Generated - Abstract base class for generated methods

=head1 VERSION

version 2.0603

=head1 DESCRIPTION

This is a C&lt;Class::MOP::Method&gt; subclass which is subclassed by
C&lt;Class::MOP::Method::Accessor&gt; and
C&lt;Class::MOP::Method::Constructor&gt;.

It is not intended to be used directly.

=head1 AUTHOR

Moose is maintained by the Moose Cabal, along with the help of many contributors. See L&lt;Moose/CABAL&gt; and L&lt;Moose/CONTRIBUTORS&gt; for details.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2012 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.

=cut


__END__


</pre></body></html>