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

NAME

Moose::Meta::Attribute - The Moose attribute metaclass

DESCRIPTION

This is a subclass of Class::MOP::Attribute with Moose specific extensions.

For the most part, the only time you will ever encounter an instance of this class is if you are doing some serious deep introspection. To really understand this class, you need to refer to the Class::MOP::Attribute documentation.

METHODS

Overridden methods

These methods override methods in Class::MOP::Attribute and add Moose specific features. You can safely assume though that they will behave just as Class::MOP::Attribute does.

new
generate_accessor_method
generate_writer_method
generate_reader_method

Additional Moose features

Moose attributes support type-contstraint checking, weak reference creation and type coercion.

has_type_constraint

Returns true if this meta-attribute has a type constraint.

type_constraint

A read-only accessor for this meta-attribute's type constraint. For more information on what you can do with this, see the documentation for Moose::Meta::TypeConstraint.

is_weak_ref

Returns true if this meta-attribute produces a weak reference.

is_required

Returns true if this meta-attribute is required to have a value.

is_lazy

Returns true if this meta-attribute should be initialized lazily.

NOTE: lazy attributes, must have a default field set.

should_coerce

Returns true if this meta-attribute should perform type coercion.

has_trigger

Returns true if this meta-attribute has a trigger set.

trigger

This is a CODE reference which will be executed every time the value of an attribute is assigned. The CODE ref will get two values, the invocant and the new value. This can be used to handle basic bi-directional relations.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2006 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.