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

NAME

Mouse::Meta::Attribute - attribute metaclass

METHODS

new %args -> Mouse::Meta::Attribute

Instantiates a new Mouse::Meta::Attribute. Does nothing else.

create OwnerClass, AttributeName, %args -> Mouse::Meta::Attribute

Creates a new attribute in OwnerClass. Accessors and helper methods are installed. Some error checking is done.

name -> AttributeName

class -> OwnerClass

is_required -> Bool

default -> Item

has_default -> Bool

is_lazy -> Bool

predicate -> MethodName | Undef

has_predicate -> Bool

clearer -> MethodName | Undef

has_clearer -> Bool

handles -> { LocalName => RemoteName }

has_handles -> Bool

is_weak_ref -> Bool

init_arg -> Str

type_constraint -> Str

has_type_constraint -> Bool

trigger => CODE | Undef

has_trigger -> Bool

builder => MethodName | Undef

has_builder -> Bool

should_auto_deref -> Bool

Informational methods.

generate_accessor -> CODE

Creates a new code reference for the attribute's accessor.

generate_predicate -> CODE

Creates a new code reference for the attribute's predicate.

generate_clearer -> CODE

Creates a new code reference for the attribute's clearer.

generate_handles -> { MethodName => CODE }

Creates a new code reference for each of the attribute's handles methods.

find_type_constraint -> CODE

Returns a code reference which can be used to check that a given value passes this attribute's type constraint;

verify_type_constraint Item -> 1 | ERROR

Checks that the given value passes this attribute's type constraint. Returns 1 on success, otherwise confesses.