1MooseX::ChainedAccessorUss(e3r)Contributed Perl DocumentMaotoisoenX::ChainedAccessors(3)
2
3
4
6 MooseX::ChainedAccessors - Accessor class for chained accessors with
7 Moose
8
10 version 0.02
11
13 package Test;
14 use Moose;
15
16 has => 'debug' => (
17 traits => [ 'Chained' ],
18 is => 'rw',
19 isa => 'Bool',
20 );
21
22 sub complex_method
23 {
24 my $self = shift;
25
26 #...
27
28 print "helper message" if $self->debug;
29
30 #...
31 }
32
33
34 1;
35
36 Which allows for:
37
38 my $test = Test->new();
39 $test->debug(1)->complex_method();
40
42 MooseX::ChainedAccessors is a Moose Trait which allows for method
43 chaining on accessors by returning $self on write/set operations.
44
46 · Moritz Onken <onken@netcubed.de>
47
48 · David McLaughlin <david@dmclaughlin.com>
49
51 This software is copyright (c) 2011 by Moritz Onken.
52
53 This is free software; you can redistribute it and/or modify it under
54 the same terms as the Perl 5 programming language system itself.
55
56
57
58perl v5.12.3 2011-04-06 MooseX::ChainedAccessors(3)