README
1
2
3This archive contains the distribution MooseX-Attribute-Chained,
4version 1.0.3:
5
6 Attribute that returns the instance to allow for chaining
7
8This software is copyright (c) 2017 by Tom Hukins.
9
10This is free software; you can redistribute it and/or modify it under
11the same terms as the Perl 5 programming language system itself.
12
13
14This README file was generated by Dist::Zilla::Plugin::Readme v6.008.
15
16
README.pod
1package MooseX::ChainedAccessors;
2
3# ABSTRACT: DEPRECATED
4use strict;
5use warnings;
6use Carp qw(confess);
7use Try::Tiny;
8use base 'Moose::Meta::Method::Accessor';
9
10sub _generate_accessor_method_inline {
11 my $self = shift;
12 my $attr = $self->associated_attribute;
13
14 return try {
15 $self->_compile_code([
16 'sub {',
17 'if (@_ > 1) {',
18 $attr->_inline_set_value('$_[0]', '$_[1]'),
19 'return $_[0];',
20 '}',
21 $attr->_inline_get_value('$_[0]'),
22 '}',
23 ]);
24 }
25 catch {
26 confess "Could not generate inline accessor because : $_";
27 };
28}
29
30sub _generate_writer_method_inline {
31 my $self = shift;
32 my $attr = $self->associated_attribute;
33
34 return try {
35 $self->_compile_code([
36 'sub {',
37 $attr->_inline_set_value('$_[0]', '$_[1]'),
38 '$_[0]',
39 '}',
40 ]);
41 }
42 catch {
43 confess "Could not generate inline writer because : $_";
44 };
45}
46
471;
48
49__END__
50
51=head1 DESCRIPTION
52
53Deprecated in favor of L<MooseX::Attribute::Chained>.
54
55