NAME
Venus::Core::Class - Class Base Class
ABSTRACT
Class Base Class for Perl 5
SYNOPSIS
package User;
use base 'Venus::Core::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:
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 1.00
import
import(Any @args) (Any)
The import method invokes the IMPORT
lifecycle hook and is invoked whenever the "use" in perlfunc declaration is used.
Since 2.91
meta
meta() (Meta)
The meta method returns a Venus::Meta objects which describes the package's configuration.
Since 1.00
- meta example 1
-
package main; my $user = User->new( fname => 'Elliot', lname => 'Alderson', ); my $meta = $user->meta; # bless({...}, 'Venus::Meta')
new
new(Any %args | HashRef $args) (Object)
The new method instantiates the class and returns a new object.
Since 1.00
- 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')
unimport
unimport(Any @args) (Any)
The unimport method invokes the UNIMPORT
lifecycle hook and is invoked whenever the "no" in perlfunc declaration is used.
Since 2.91
AUTHORS
Awncorp, awncorp@cpan.org
LICENSE
Copyright (C) 2000, Al Newkirk.
This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.