• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/H13-Jan-2017-734240

t/H13-Jan-2017-606411

Build.PLH A D13-Jan-20171.6 KiB6948

ChangesH A D13-Jan-2017598 2418

LICENSEH A D13-Jan-201717.9 KiB380292

MANIFESTH A D13-Jan-2017657 3029

META.jsonH A D13-Jan-201718.9 KiB594592

META.ymlH A D13-Jan-201711.9 KiB432431

READMEH A D13-Jan-2017404 167

README.podH A D13-Jan-20171.1 KiB5544

dist.iniH A D13-Jan-20171.1 KiB6857

weaver.iniH A D13-Jan-201719 42

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