summary refs log tree commit diff
path: root/lib/MooseX/Net/API/Meta/Class.pm
blob: e4bed0caf7f07df67b1ff230193c11b66b44798a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package MooseX::Net::API::Meta::Class;

use Moose::Role;
use Moose::Meta::Class;
use MooseX::Types::Moose qw(Str ArrayRef ClassName Object);

has local_api_methods => (
    traits     => ['Array'],
    is         => 'ro',
    isa        => ArrayRef [Str],
    required   => 1,
    default    => sub { [] },
    auto_deref => 1,
    handles    => { '_add_api_method' => 'push' },
);

sub _build_meta_class {
    my $self = shift;
    return Moose::Meta::Class->create_anon_class(
        superclasses => [ $self->method_metaclass ],
        cache        => 1,
    );
}

1;