Class::Accessor::Chained - make chained accessors


Class-Accessor-Chained documentation  | view source Contained in the Class-Accessor-Chained distribution.

Index


NAME

Top

Class::Accessor::Chained - make chained accessors

SYNOPSIS

Top

 package Foo;
 use base qw( Class::Accessor::Chained );
 __PACKAGE__->mk_accessors(qw( foo bar baz ));

 my $foo = Foo->new->foo(1)->bar(2)->baz(4);
 print $foo->bar; # prints 2

DESCRIPTION

Top

A chained accessor is one that always returns the object when called with parameters (to set), and the value of the field when called with no arguments.

This module subclasses Class::Accessor in order to provide the same mk_accessors interface.

AUTHOR

Top

Richard Clamp <richardc@unixbeard.net>

COPYRIGHT

Top

SEE ALSO

Top

Class::Accessor, Class::Accessor::Chained::Fast


Class-Accessor-Chained documentation  | view source Contained in the Class-Accessor-Chained distribution.