summaryrefslogtreecommitdiffstats
path: root/lib/Class/Info/Method.pm
blob: 43742c0e90e52b6c790b50f1246a6482da411e52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package Class::Info::Method;
use Moose;

has method => (
    is       => 'ro',
    isa      => 'Class::MOP::Method',
    required => 1,
    handles  => qr/.*/,
);

sub BUILDARGS {
    my $class = shift;
    return { method => $_[0] } if @_ == 1;
    return $class->SUPER::BUILDARGS(@_);
}

sub as_string {
    my $self = shift;
    return $self->name . " (" . blessed($self->method) . ")";
}

1;