use warnings;
use base 'Exporter';
-our $VERSION = '0.10';
+our $VERSION = '0.12';
use 5.006;
use Carp 'confess';
my $meta = Mouse::Meta::Class->initialize(caller);
my $role = shift;
+ my $args = shift || {};
- confess "Mouse::Role only supports 'with' on individual roles at a time" if @_;
+ confess "Mouse::Role only supports 'with' on individual roles at a time" if @_ || !ref $args;
Mouse::load_class($role);
- $role->meta->apply($meta);
+ $role->meta->apply($meta, %$args);
}
sub import {
has a builder, then providing a value for the attribute in the constructor is
optional.
-=item init_arg => Str
+=item init_arg => Str | Undef
-Allows you to use a different key name in the constructor.
+Allows you to use a different key name in the constructor. If undef, the
+attribue can't be passed to the constructor.
=item default => Value | CodeRef
bucket status). You must specify an appropriate type constraint to use
auto_deref.
+=item lazy_build => 0|1
+
+Automatically define lazy => 1 as well as builder => "_build_$attr", clearer =>
+"clear_$attr', predicate => 'has_$attr' unless they are already defined.
+
=back
=head2 confess error -> BOOM