Mic

 view release on metacpan or  search on metacpan

lib/Mic.pm  view on Meta::CPAN

our $VERSION = '0.001004';
$VERSION = eval $VERSION;

my $Class_count = 0;
our %Bound_implementation_of;
our %Contracts_for;
our %Spec_for;
our %Util_class;

sub import {
    strict->import();
}

sub load_class {
    my ($class, $spec) = @_;

    $spec->{name} ||= "Mic::Class_${\ ++$Class_count }";
    $class->assemble($spec);
}

sub assemble {

lib/Mic/Bind.pm  view on Meta::CPAN

package Mic::Bind;
use strict;

sub import {
    my (undef, %binding) = @_;

    foreach my $class ( keys %binding ) {
        $Mic::Bound_implementation_of{$class} = $binding{$class};
    }
    strict->import();
}

1;

__END__

=head1 NAME

Mic::Bind

lib/Mic/Class.pm  view on Meta::CPAN

package Mic::Class;
use strict;
use Mic ();

sub import {
    my ($class, %arg) = @_;

    strict->import();
    Mic->assemble(\%arg);
}

1;

__END__

=head1 NAME

Mic::Class

lib/Mic/Contracts.pm  view on Meta::CPAN

package Mic::Contracts;
use strict;
use Mic::ContractConfig;

sub import {
    my (undef, %contract_for) = @_;

    Mic::ContractConfig::configure(\ %contract_for);
    strict->import();
}

1;

__END__

=head1 NAME

Mic::Contracts

lib/Mic/Implementation.pm  view on Meta::CPAN

use Params::Validate qw(:all);

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);

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

Mic::Interface



( run in 0.716 second using v1.01-cache-2.11-cpan-299005ec8e3 )