Role::TinyX::Override - adds "override method => sub {...}" support to Role::Tiny
use v5.14; use strict; use Test::More; package Foo { sub new { bless []=> shift } sub foo { return "foo" } } package Bar { use Role::Tiny; use Role::TinyX::Override; override foo => sub { return uc super; }; } package Foo::Bar { BEGIN { our @ISA = 'Foo' }; use Role::Tiny::With; with qw(Bar); } is( Foo::Bar->new->foo, "FOO" ); done_testing();
Role::TinyX::Override extends Role::Tiny with the override method modifier, allowing you to use this Moose syntactic sugar for overriding superclass methods in Role::Tiny roles.
override
See Class::Method::ModifiersX::Override for further details.
Role::Tiny, Class::Method::ModifiersX::Override.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Class::Method::ModifiersX::Override, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Method::ModifiersX::Override
CPAN shell
perl -MCPAN -e shell install Class::Method::ModifiersX::Override
For more information on module installation, please visit the detailed CPAN module installation guide.