~ubuntu-branches/ubuntu/precise/libmoosex-aliases-perl/precise

« back to all changes in this revision

Viewing changes to lib/MooseX/Aliases/Meta/Trait/Attribute.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu
  • Date: 2011-02-26 22:55:41 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110226225541-eiamo6l2vqqdbdtu
Tags: 0.09-1
* New upstream release
* Bump to debhelper compat 8
* Use new 3.0 (quilt) source format
* Standards-Version 3.9.1
  - Explicitly refer to GPL-1 license text in common-licenses.
* Update dependencies per upstream
* No longer run RELEASE_TESTING tests
* Refresh copyright information

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package MooseX::Aliases::Meta::Trait::Attribute;
2
 
our $VERSION = '0.08';
 
2
BEGIN {
 
3
  $MooseX::Aliases::Meta::Trait::Attribute::VERSION = '0.09';
 
4
}
3
5
use Moose::Role;
4
6
use Moose::Util::TypeConstraints;
5
7
Moose::Util::meta_attribute_alias 'Aliased';
6
 
 
7
 
=head1 NAME
8
 
 
9
 
MooseX::Aliases::Meta::Trait::Attribute - attribute metaclass trait for L<MooseX::Aliases>
10
 
 
11
 
=head1 VERSION
12
 
 
13
 
version 0.08
14
 
 
15
 
=head1 SYNOPSIS
16
 
 
17
 
    package MyApp::Role;
18
 
    use Moose::Role;
19
 
    use MooseX::Aliases;
20
 
 
21
 
    has this => (
22
 
        isa   => 'Str',
23
 
        is    => 'rw',
24
 
        traits => [qw(Aliased)],
25
 
        alias => 'that',
26
 
    );
27
 
 
28
 
=head1 DESCRIPTION
29
 
 
30
 
This trait adds the C<alias> option to attribute creation. It is automatically
31
 
applied to all attributes when C<use MooseX::Aliases;> is run, but must be
32
 
explicitly applied in roles, due to issues with Moose's handling of attributes
33
 
in roles.
34
 
 
35
 
=cut
 
8
# ABSTRACT: attribute metaclass trait for L<MooseX::Aliases>
 
9
 
36
10
 
37
11
subtype 'MooseX::Aliases::ArrayRef', as 'ArrayRef[Str]';
38
12
coerce  'MooseX::Aliases::ArrayRef', from 'Str', via { [$_] };
89
63
 
90
64
no Moose::Role;
91
65
 
 
66
1;
 
67
 
 
68
__END__
 
69
=pod
 
70
 
 
71
=head1 NAME
 
72
 
 
73
MooseX::Aliases::Meta::Trait::Attribute - attribute metaclass trait for L<MooseX::Aliases>
 
74
 
 
75
=head1 VERSION
 
76
 
 
77
version 0.09
 
78
 
 
79
=head1 SYNOPSIS
 
80
 
 
81
    package MyApp::Role;
 
82
    use Moose::Role;
 
83
    use MooseX::Aliases;
 
84
 
 
85
    has this => (
 
86
        isa   => 'Str',
 
87
        is    => 'rw',
 
88
        alias => 'that',
 
89
    );
 
90
 
 
91
=head1 DESCRIPTION
 
92
 
 
93
This trait adds the C<alias> option to attribute creation. It is automatically
 
94
applied to all attributes when C<use MooseX::Aliases;> is run.
 
95
 
 
96
=head1 SEE ALSO
 
97
 
 
98
=over 4
 
99
 
 
100
=item *
 
101
 
 
102
L<MooseX::Aliases>
 
103
 
 
104
=back
 
105
 
92
106
=head1 AUTHORS
93
107
 
94
 
  Jesse Luehrs <doy at tozt dot net>
95
 
 
96
 
  Chris Prather (chris@prather.org)
97
 
 
98
 
  Justin Hunter <justin.d.hunter at gmail dot com>
 
108
=over 4
 
109
 
 
110
=item *
 
111
 
 
112
Jesse Luehrs <doy at tozt dot net>
 
113
 
 
114
=item *
 
115
 
 
116
Chris Prather <chris@prather.org>
 
117
 
 
118
=item *
 
119
 
 
120
Justin Hunter <justin.d.hunter at gmail dot com>
 
121
 
 
122
=back
99
123
 
100
124
=head1 COPYRIGHT AND LICENSE
101
125
 
102
 
This software is copyright (c) 2009 by Jesse Luehrs.
 
126
This software is copyright (c) 2011 by Jesse Luehrs.
103
127
 
104
128
This is free software; you can redistribute it and/or modify it under
105
 
the same terms as perl itself.
 
129
the same terms as the Perl 5 programming language system itself.
106
130
 
107
131
=cut
108
132
 
109
 
1;
 
 
b'\\ No newline at end of file'