Aion

 view release on metacpan or  search on metacpan

t/aion/meta/requires-any-function.pm  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  BEGIN {     $SIG{__DIE__} = sub ...
# 
# use common::sense;
# 
# use Aion::Meta::Util qw//;
# 
# Aion::Meta::Util::create_getters(qw/pkg name/);
# 
# sub new {
#     my $cls = shift;
#     bless {@_}, ref $cls || $cls;
# }
# 
# sub compare {
#     my ($self, $other) = @_;
# 
#    	die "$self->{name} requires!" unless ref $other eq 'CODE';
# }
# 
# 1;
# 
# __END__
# 
# =encoding utf-8
# 
# =head1 NAME
# 
# Aion::Meta::RequiresAnyFunction - defines any function that must be in the module
# 
# =head1 SYNOPSIS
# 
# 	use Aion::Meta::RequiresAnyFunction;
# 	
# 	my $any_function = Aion::Meta::RequiresAnyFunction->new(
# 		pkg => 'My::Package', name => 'my_function'
# 	);
# 
# =head1 DESCRIPTION
# 
# It is created in C<requires fn1, fn2...> and when initializing the class it is checked that such a function was declared in it using C<sub> or C<has>.
# 
# =head1 SUBROUTINES
# 
# =head2 new (%args)
# 
# Constructor.
# 
# =head2 compare (CodeRef|Undef $other)
# 
# Checks that C<$other> is a function.
# 
# 	my $any_function = Aion::Meta::AnyFunction->new;
# 	eval { $any_function->compare(undef) }; $@  # ~> .3
# 
# =head1 AUTHOR
# 
# Yaroslav O. Kosmina L<mailto:dart@cpan.org>
# 
# =head1 LICENSE
# 
# âš– B<GPLv3>



( run in 1.409 second using v1.01-cache-2.11-cpan-39bf76dae61 )