X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FRole.pm;h=1065cfec58e7c72f1c1437c9de414488dde890b5;hb=ac4b3ad43aa91878ee9bc786e1800d5e9fbd876f;hp=f2033fa33d540501f2e0a134c08757d42a498079;hpb=e3d94ac0990080399851812a76928c893c3cd4fa;p=gitmo%2FMoose.git diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index f2033fa..1065cfe 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -1,12 +1,13 @@ - package Moose::Role; +use strict; +use warnings; use Scalar::Util 'blessed'; use Carp 'croak'; use Sub::Exporter; -our $VERSION = '0.82'; +our $VERSION = '0.88'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -41,7 +42,7 @@ sub has { my $meta = Moose::Meta::Role->initialize(shift); my $name = shift; croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1; - my %options = @_; + my %options = ( definition_context => Moose::Util::_caller_info(), @_ ); my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ]; $meta->add_attribute( $_, %options ) for @$attrs; } @@ -174,7 +175,7 @@ Moose::Role - The Moose Role =head1 DESCRIPTION -The concept of roles is documented in L. This document +The concept of roles is documented in L. This document serves as API documentation. =head1 EXPORTED FUNCTIONS