Mic
view release on metacpan or search on metacpan
lib/Mic/Implementation.pm view on Meta::CPAN
sub import {
my $class = shift;
my %arg = validate(@_, {
has => { type => HASHREF },
classmethod => { type => ARRAYREF, optional => 1 },
});
strict->import();
$arg{-caller} = (caller)[0];
$class->define(%arg);
}
sub define {
my ($class, %arg) = @_;
my $caller_pkg = delete $arg{-caller} || (caller)[0];
my $stash = Package::Stash->new($caller_pkg);
$class->add_attribute_syms(\%arg, $stash);
$stash->add_symbol('%__meta__', \%arg);
}
sub add_attribute_syms {
my ($class, $arg, $stash) = @_;
lib/Mic/Interface.pm view on Meta::CPAN
package Mic::Interface;
use strict;
sub import {
my ($class, %arg) = @_;
my $caller_pkg = (caller)[0];
$Mic::Spec_for{$caller_pkg}{interface} = \%arg;
strict->import();
}
1;
__END__
=head1 NAME
( run in 0.769 second using v1.01-cache-2.11-cpan-a3c8064c92c )