mo-pm
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Perl Micro Objects
=encoding utf8

=head1 Name

Mo - Micro Objects. Mo is less.

=head1 Synopsis

    package Less;
    use Mo;
    extends 'Nothing';

    has something => ();

=head1 Description

use Mo. Mo is less. Much less.

Moose is huge. Moose led to Mouse led to Moo led to Mo. M is nothing. Mo is
more. Not much.

When Moo is more than you need, drop an 'o' and get some Mo.

To get just a little Mo from Mo, use L below.

=head1 Core Features

This is what you get. Nothing Mo.

=over

=item C method

Mo provides a C object constructor. You pass it a list of name/value
pairs and it returns a new object.

Constructor will not call BUILD methods. This is available using the
L feature.

=item C

Mo exports the C keyword, to declare your parent class. C
itself is your default parent class.

Mo only supports single inheritance. If you need multiple inheritance or
roles, you should upgrade to Moo.

=item C

Mo exports a C keyword, to generate accessors.

These accessors always support both C and C operations. That's it.

    has name => ();
    has thing => (foo => 'bar');  # arguments silently ignored

All arguments passed to C are ignored. This makes it easier to switch
between Mo and Moo, without having to change all your accessors.

=item C and C

Mo turns on C and C for you.

=item Embeddable

Mo is tiny. It is compressed into a single line. You can easily inline it in
your code, should you want to do that. See L for more information,
including a utility that will do it for you.

=back

=head1 Mo Features

Mo is the bare minimum needed for Perl OO. Many times you'll want just a
couple more features. Don't worry. Mo's got you covered:

    use Mo qw'build default builder coerce is required';
    has name1 => ( default => sub { 'Joe' } );
    has name2 => ( builder => 'name_builder' );
    has name3 => ( coerce => sub {$_[0]} );
    has name4 => ( is => 'ro' );
    has name4 => ( required => 1 );
    sub BUILD {
        my $self = shift;
        ...
    }

Mo simply loads the feature classes L, L,
L, L, L and L.
The first one supports BUILD constructing and the other three
add their magics to C. A L module can enhance C,
C and C, and also add new export subs, or remove existing ones.
Features can also be combined for a single accessor.
See L for a list of all the features and for an explanation of
the Feature API..

=head1 See

L

L

L

L

=head1 Status

=begin html

Build Status

=end html =head1 Authors Ingy döt Net Damien 'dams' Krotkine Matt S. Trout (mst) Christian Walde Alessandro Ranellucci (aar/alexrj) Carlos Lima (priodev) =head1 Copyright and License Copyright (c) 2011-2016. Ingy döt Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html =cut

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。