Ambrosia::Meta - another tool to build classes for Perl 5.
version 0.010
package MyClass; use Ambrosia::Meta; class { extends => [qw/base_class1 base_class2/], public => [qw/public_field1 public_field2/], protected => [qw/protected_field1 protected_field2/], private => [qw/private_field1 private_field2/], }; sub next { my $self = shift; return $self->private1++; } 1;
Ambrosia::Meta used to create classes with the definition of access rights to the fields. Ambrosia::Meta is a sealed class, you cannot use it as base class for your classes.
You can mark the created class one of qualifiers, such as inheritable (the default), abstract and sealed:
class inheritable { };
or equivalent
class { }; class abstract { }; class sealed { };
The usual definition of the class.
If you mark your class as abstract it means that you cannot create an object with type of this class.
This means that you cannot derive a class from it.
This is the reference to the list of base classes.
This is the reference to the list of public fields.
This is the reference to the list of protected fields.
This is the reference to the list of private fields.
In your class created with the help of Ambrosia::Meta you can use several predefined attributes for methods of class.
Does nothing. Just marked that this method is public.
Marks method as protected method.
Marks method as private method.
Marks method as abstract method. If at least one method in class have this attribute this class marks as abstract.
All classes created with the help of Ambrosia::Meta have Ambrosia::core::Object as a base class.
WARNING! Method names in the generated class can not start with "__AMBROSIA". Also, it concerns the package variables.
Exporter Ambrosia::error::Exceptions Ambrosia::core::Object
Not tested.
Please report bugs relevant to Ambrosia to <knm[at]cpan.org>.
Ambrosia
Ambrosia Ambrosia::core::Object
Copyright (C) 2010-2012 Nickolay Kuritsyn. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Nikolay Kuritsyn (knm[at]cpan.org)
To install Ambrosia, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ambrosia
CPAN shell
perl -MCPAN -e shell install Ambrosia
For more information on module installation, please visit the detailed CPAN module installation guide.