GX::Class

Module Version: 0.2000_01

NAME

GX::Class - Universal base class

SYNOPSIS

package My::Class;

use GX::Class;

# ...

1;

DESCRIPTION

This module provides the GX::Class class.

METHODS

Public Methods

meta

Returns the GX::Meta::Class metaobject that represents the class.

$meta = $class->meta;
Returns:

Internal Methods

import

Internal method.

$class->import( %arguments );
Arguments:
  • code_attributes ( ARRAY reference )

    A reference to an array containing the allowed code attributes. The given code attributes must be simple names. See attributes for details.

  • extends ( string | ARRAY reference )

    A class name or a reference to an array containing class names. See extends() below.

  • meta ( GX::Meta::Class object )

    The class metaobject to associate with the class.

  • superclass ( string )

    A class name. Prepended to the @ISA array of the class before the classes specified by extends.

  • with ( string | ARRAY reference )

    A package name or a reference to an array containing package names. See with() below.

unimport

Internal method.

$class->unimport;

EXPORTS

Functions and Keywords

The following functions / keywords are exported by default.

build

Builds the class.

build;

If this function is called, it MUST be called after the class has been completely defined but before any derived classes are loaded.

extends

Loads the specified classes (if found in @INC) and prepends them to the @ISA array of the class.

extends @superclasses;
Arguments:
  • @superclasses ( strings )

    A list of class names.

has

Declares an attribute.

has $attribute_name => %attribute_properties;
Arguments:
  • $attribute_name ( string )

    The name of the attribute.

  • %attribute_properties ( named list ) [ optional ]

    The attribute properties. See GX::Meta::Attribute for details.

static

A modifier for has() that makes the respective attribute static.

has static $attribute_name => %attribute_properties;

with

Mixes the specified classes / packages into the class.

with @mixins;
Arguments:
  • @mixins ( strings )

    A list of class / package names.

SUBCLASSES

The following classes inherit directly from GX::Class:

SEE ALSO

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright © 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.