Types::HasTypedMethods - It's new $module
use Types::HasTypedMethods -types;
my $type = HasTypedMethods[
add => [ [Int, Int] => Int ],
do_something => +{
params => [Int, Int],
isa => Int,
},
];
package HasMethodsClass {
use Types::Standard -types;
use Sub::WrapInType qw( install_method );
sub new { bless +{}, shift }
install_method add => [Int, Int] => Int, sub { $_[0] + $_[1] };
install_method do_something => [Int, Int] => Int, sub { $_[0] - $_[1] };
}
$type->check(HasMethodsClass->new);
Types::HasTypedMethods is ...
Copyright (C) ybrliiu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
mpoliiu raian@reeshome.org