NAME
Mars::Kind::Mixin - Mixin Base Class
ABSTRACT
Mixin Base Class for Perl 5
SYNOPSIS
package Person;
use base 'Mars::Kind::Mixin';
package User;
use base 'Mars::Kind::Class';
package main;
my $user = User->MIXIN('Person')->new(
fname => 'Elliot',
lname => 'Alderson',
);
# bless({fname => 'Elliot', lname => 'Alderson'}, 'User')
DESCRIPTION
This package provides a mixin base class with mixin building and object construction lifecycle hooks.
INHERITS
This package inherits behaviors from:
METHODS
This package provides the following methods:
does
does(Str $name) (Bool)
The does method returns true if the object is composed of the role provided.
Since 0.05
- does example 1
-
package Employee; use base 'Mars::Kind::Mixin'; Employee->MIXIN('Person'); package main; my $user = User->MIXIN('Employee')->new( fname => 'Elliot', lname => 'Alderson', ); my $does = Employee->does('Person'); # 1
meta
meta() (Meta)
The meta method returns a Mars::Meta objects which describes the package's configuration.
Since 0.05
- meta example 1
-
package main; my $user = User->MIXIN('Person')->new( fname => 'Elliot', lname => 'Alderson', ); my $meta = Person->meta; # bless({...}, 'Mars::Meta')
AUTHORS
Awncorp, awncorp@cpan.org