NAME
Mars::Kind::Role - Role Base Class
ABSTRACT
Role Base Class for Perl 5
SYNOPSIS
package Person;
use base 'Mars::Kind::Role';
package User;
use base 'Mars::Kind::Class';
package main;
my $user = User->ROLE('Person')->new(
fname => 'Elliot',
lname => 'Alderson',
);
# bless({fname => 'Elliot', lname => 'Alderson'}, 'User')
DESCRIPTION
This package provides a role base class with role 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.01
- does example 1
-
package main; my $user = User->ROLE('Person')->new( fname => 'Elliot', lname => 'Alderson', ); my $does = $user->does('Person'); # 1
meta
meta() (Meta)
The meta method returns a Mars::Meta objects which describes the package's configuration.
Since 0.01
- meta example 1
-
package main; my $user = User->ROLE('Person')->new( fname => 'Elliot', lname => 'Alderson', ); my $meta = $user->meta; # bless({...}, 'Mars::Meta')
AUTHORS
Awncorp, awncorp@cpan.org