Venus::Core::Class

Class Base Class

Class Base Class for Perl 5

method: import method: does method: meta method: new method: unimport

package User;

use base 'Venus::Core::Class';

package main;

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

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

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

Venus::Core

The import method invokes the IMPORT lifecycle hook and is invoked whenever the "use" in perlfunc declaration is used.

import(any @args) (any)

{ since => '2.91', }

=example-1 import

package main;

use User;

# ()

The does method returns true if the object is composed of the role provided.

does(string $name) (boolean)

{ since => '1.00', }

=example-1 does

# given: synopsis

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

# 0

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

meta() (Venus::Meta)

{ since => '1.00', }

=example-1 meta

package main;

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

my $meta = $user->meta;

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

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

new(any %args | hashref $args) (object)

{ since => '1.00', }

=example-1 new

package main;

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

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

The unimport method invokes the UNIMPORT lifecycle hook and is invoked whenever the "no" in perlfunc declaration is used.

unimport(any @args) (any)

{ since => '2.91', }

t/Venus.t: present: authors t/Venus.t: present: license

25 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 49:

Unknown directive: =synopsis

Around line 77:

Unknown directive: =description

Around line 86:

Unknown directive: =inherits

Around line 94:

Unknown directive: =method

Around line 99:

Unknown directive: =signature

Around line 103:

Unknown directive: =metadata

Around line 123:

Unknown directive: =method

Around line 127:

Unknown directive: =signature

Around line 131:

Unknown directive: =metadata

Around line 155:

Unknown directive: =method

Around line 160:

Unknown directive: =signature

Around line 164:

Unknown directive: =metadata

Around line 193:

Unknown directive: =method

Around line 197:

Unknown directive: =signature

Around line 201:

Unknown directive: =metadata

Around line 242:

=cut found outside a pod block. Skipping to next block.

Around line 255:

Unknown directive: =method

Around line 260:

Unknown directive: =signature

Around line 264:

Unknown directive: =metadata

Around line 280:

=cut found outside a pod block. Skipping to next block.

Around line 286:

Unknown directive: =partials