like an attribute,.. but if you
look behind the curtain,.. its
over there.. in that other object
-
-- moosedoc
-
-We certainly have enough meta-information to make pretty complete POD docs.
- compile time extends
and that if this usage style is used nothing is exported to the namespace.
-
- default should dclone()
+- auto_deref => 1 for auto-de-refing ARRAY and HASH attrs
+
-------------------------------------------------------------------------------
TO PONDER
-------------------------------------------------------------------------------
To explain Moose from a very high level
+- moosedoc
+We certainly have enough meta-information to make pretty complete POD docs.
-use lib '/Users/stevan/Projects/CPAN/Class-MOP/Class-MOP/lib';
-
package Moose;
use strict;
# but if we have anything else,
# we need to check it out ...
unless (# see if of our metaclass is incompatible
- $meta->isa(blessed($super->meta)) &&
- # see if our instance metaclass is incompatible
- $meta->instance_metaclass->isa($super->meta->instance_metaclass) &&
+ ($meta->isa(blessed($super->meta)) &&
+ # and see if our instance metaclass is incompatible
+ $meta->instance_metaclass->isa($super->meta->instance_metaclass)) &&
# ... and if we are just a vanilla Moose
$meta->isa('Moose::Meta::Class')) {
# re-initialize the meta ...
my $super_meta = $super->meta;
+ # NOTE:
+ # We might want to consider actually
+ # transfering any attributes from the
+ # original meta into this one, but in
+ # general you should not have any there
+ # at this point anyway, so it's very
+ # much an obscure edge case anyway
$meta = $super_meta->reinitialize($class => (
':attribute_metaclass' => $super_meta->attribute_metaclass,
':method_metaclass' => $super_meta->method_metaclass,
return subname 'Moose::with' => sub {
my ($role) = @_;
_load_all_classes($role);
+ ($role->can('meta') && $role->meta->isa('Moose::Meta::Role'))
+ || confess "You can only consume roles, $role is not a Moose role";
$role->meta->apply($class->meta);
};
},
use strict;
use warnings;
-use Test::More tests => 10;
+use Test::More tests => 11;
use Test::Exception;
BEGIN {
use warnings;
use Moose;
- ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class';
+ ::dies_ok { with('Foo::Class') } '... cannot consume a class, it must be a role';
+ ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class';
sub foo { 'Bar::Class::foo' }
}