NAME

Mars::Kind::Class - Class Base Class

ABSTRACT

Class Base Class for Perl 5

SYNOPSIS

package User;

use base 'Mars::Kind::Class';

package main;

my $user = User->new(
  fname => 'Elliot',
  lname => 'Alderson',
);

# bless({fname => 'Elliot', lname => 'Alderson'}, 'User')

DESCRIPTION

This package provides a class base class with class building and object construction lifecycle hooks.

INHERITS

This package inherits behaviors from:

Mars::Kind

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
# given: synopsis

my $does = $user->does('Identity');

# 0

meta

meta() (Meta)

The meta method returns a Mars::Meta objects which describes the package's configuration.

Since 0.01

meta example 1
# given: synopsis

package main;

my $user = User->new(
  fname => 'Elliot',
  lname => 'Alderson',
);

my $meta = $user->meta;

# bless({...}, 'Mars::Meta')

new

new(Any %args | HashRef $args) (Object)

The new method instantiates the class and returns a new object.

Since 0.01

new example 1
package main;

my $user = User->new(
  fname => 'Elliot',
  lname => 'Alderson',
);

# bless({fname => 'Elliot', lname => 'Alderson'}, 'User')
new example 2
package main;

my $user = User->new({
  fname => 'Elliot',
  lname => 'Alderson',
});

# bless({fname => 'Elliot', lname => 'Alderson'}, 'User')

AUTHORS

Awncorp, awncorp@cpan.org