The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Ambrosia::Meta - another tool to build classes for Perl 5.

VERSION

version 0.010

SYNOPSIS

    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;

DESCRIPTION

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
    {
    };
class inheritable

The usual definition of the class.

class abstract

If you mark your class as abstract it means that you cannot create an object with type of this class.

class sealed

This means that you cannot derive a class from it.

KEYWORDS

extends

This is the reference to the list of base classes.

public

This is the reference to the list of public fields.

protected

This is the reference to the list of protected fields.

private

This is the reference to the list of private fields.

ATTRIBUTES

In your class created with the help of Ambrosia::Meta you can use several predefined attributes for methods of class.

Public

Does nothing. Just marked that this method is public.

Protected

Marks method as protected method.

Private

Marks method as private method.

Abstract

Marks method as abstract method. If at least one method in class have this attribute this class marks as abstract.

METHODS

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.

DEPENDENCIES

Exporter Ambrosia::error::Exceptions Ambrosia::core::Object

THREADS

Not tested.

BUGS

Please report bugs relevant to Ambrosia to <knm[at]cpan.org>.

SEE ALSO

Ambrosia Ambrosia::core::Object

COPYRIGHT AND LICENSE

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.

AUTHOR

Nikolay Kuritsyn (knm[at]cpan.org)