=head1 AUTHORS
-Shawn M Moore, C<< <sartak at gmail.com> >>
+Shawn M Moore, E<lt>sartak at gmail.comE<gt>
-Yuval Kogman, C<< <nothingmuch at woobling.org> >>
+Yuval Kogman, E<lt>nothingmuch at woobling.orgE<gt>
tokuhirom
wu-lee
-Goro Fuji (gfx) C<< <gfuji at cpan.org> >>
+Goro Fuji (gfx) E<lt>gfuji at cpan.orgE<gt>
with plenty of code borrowed from L<Class::MOP> and L<Moose>
return $attr;
};
+ around 'canonicalize_args' => sub {\r
+ my ($next, $self, $name, %args) = @_;\r
+\r
+ %args = $next->($self, $name, %args);\r
+ $args{is} = 'rw' unless exists $args{is};\r
+\r
+ return %args;\r
+ };\r
+
package # hide me from search.cpan.org
Mouse::Meta::Attribute::Custom::Number;
sub register_implementation { 'MouseX::AttributeHelpers::Number' }
package Klass;
use Mouse;
- has 'i' => (
+ has 'number' => (
metaclass => 'Number',
- is => 'rw',
isa => 'Int',
provides => {
'add' => 'add_number'
);
};
-can_ok 'Klass', 'add_number';
+can_ok 'Klass', 'add_number', 'number';
my $k = Klass->new(i=>3);
$k->add_number(4);
-is $k->i, 7;
+is $k->number, 7;