package MooseX::StrictConstructor::Trait::ApplicationToClass;
use Moose::Role;

around apply => sub {
    my $orig  = shift;
    my $self  = shift;
    my ($role, $class) = @_;

    Moose::Util::MetaRole::apply_base_class_roles(
        for => $class,
        roles => ['MooseX::StrictConstructor::Role::Object'],
    );

    $class = Moose::Util::MetaRole::apply_metaroles(
        for             => $class,
        class_metaroles => {
            class => [ 'MooseX::StrictConstructor::Trait::Class' ],
        }
    );

    $self->$orig( $role, $class );
};

no Moose::Role;

1;
