Venus::Core::Class

Class Base Class

Class Base Class for Perl 5

method: clone 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 clone method returns a cloned object.

clone() (object)

{ since => '4.15', }

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

29 POD Errors

The following errors were encountered while parsing the POD:

Around line 14:

Unknown directive: =name

Around line 22:

Unknown directive: =tagline

Around line 30:

Unknown directive: =abstract

Around line 38:

Unknown directive: =includes

Around line 51:

Unknown directive: =synopsis

Around line 79:

Unknown directive: =description

Around line 88:

Unknown directive: =inherits

Around line 96:

Unknown directive: =method

Around line 101:

Unknown directive: =signature

Around line 105:

Unknown directive: =metadata

Around line 125:

Unknown directive: =method

Around line 129:

Unknown directive: =signature

Around line 133:

Unknown directive: =metadata

Around line 149:

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

Around line 164:

Unknown directive: =method

Around line 168:

Unknown directive: =signature

Around line 172:

Unknown directive: =metadata

Around line 196:

Unknown directive: =method

Around line 201:

Unknown directive: =signature

Around line 205:

Unknown directive: =metadata

Around line 234:

Unknown directive: =method

Around line 238:

Unknown directive: =signature

Around line 242:

Unknown directive: =metadata

Around line 283:

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

Around line 296:

Unknown directive: =method

Around line 301:

Unknown directive: =signature

Around line 305:

Unknown directive: =metadata

Around line 321:

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

Around line 327:

Unknown directive: =partials