package MooseX::StrictConstructor::FromRole;

use strict;
use warnings;

use Moose 0.94 ();
use Moose::Exporter;
use Moose::Util::MetaRole;

{
    my %class_meta = ( class => ['MooseX::StrictConstructor::Trait::Class'] );
    my %role_meta;

    if ( $Moose::VERSION < 1.9900 ) {
        require MooseX::StrictConstructor::Trait::Method::Constructor;
        $class_meta{constructor}
            = ['MooseX::StrictConstructor::Trait::Method::Constructor'];
    }
    else
    {
        %role_meta
            = (
                role => ['MooseX::StrictConstructor::Trait::Role'],
                application_to_class => ['MooseX::StrictConstructor::Trait::ApplicationToClass'],
                application_to_role =>['MooseX::StrictConstructor::Trait::ApplicationToRole'],
              );
    }

    Moose::Exporter->setup_import_methods(
        class_metaroles => \%class_meta,
        role_metaroles  => \%role_meta,
    );
}

1;

# ABSTRACT: MooseX::StrictConstructor behaviour when used from a role

__END__

=pod

=head1 DESCRIPTION

This package is equivalent to C<Moosex::StrictConstructor> except that it also
works from roles.  This is only available in Moose 2.0 and later.

=cut
