Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # Perl module for Pastel::Root |
2 | # Author: Malay < curiouser@ccmp.ap.nic.in > | |
3 | # Copyright Malay | |
4 | # You may distribute this module under the same terms as perl itself | |
5 | ||
6 | # POD documentation - main docs before the code | |
7 | ||
8 | =head1 NAME | |
9 | ||
10 | Pastel::Root - Root class for Pastel library the constructor new in inherited by all Pastel classes. All the initialization is done by the _init() function of each class. | |
11 | ||
12 | =head1 SYNOPSIS | |
13 | ||
14 | This is an virtual base class and not to instantiated directly. | |
15 | ||
16 | =head1 DESCRIPTION | |
17 | ||
18 | This class is a virtual base class. The new in inherited in all the classes. This class is not to be instantiated directly. Look into the individual classes in the library for the constructor call. | |
19 | ||
20 | =head1 CONTACT | |
21 | ||
22 | Malay <curiouser@ccmb.ap.nic.in> | |
23 | ||
24 | =cut | |
25 | ||
26 | # Let the code begin... | |
27 | ||
28 | ||
29 | package Pastel::Root; | |
30 | @ISA = qw (Pastel::Mixin::Mixin); # Get the _rearrange function | |
31 | use Pastel::Mixin::Mixin; | |
32 | ||
33 | use strict; | |
34 | ||
35 | sub new { | |
36 | my $class = shift; | |
37 | my $self = {}; | |
38 | bless $self, ref($class) || $class; | |
39 | $self->_init(@_); # Call the _init() function of the caller | |
40 | return $self; | |
41 | } | |
42 | ||
43 | sub DESTROY { | |
44 | my $self = shift; | |
45 | foreach my $key (keys %{$self}){ | |
46 | delete $self->{$key}; | |
47 | } | |
48 | } | |
49 | ||
50 | 1; |