Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / MooseX / Role / Parameterized / Meta / Parameter.pm
1 package MooseX::Role::Parameterized::Meta::Parameter;
2 use Moose;
3 extends 'Moose::Meta::Attribute';
4
5 our $VERSION = '0.10';
6
7 # This doesn't actually do anything because _process_options does not consult
8 # the default value of "is". hrm.
9 has '+is' => (
10     default => 'ro',
11 );
12
13 around _process_options => sub {
14     my $orig = shift;
15     my ($class, $name, $options) = @_;
16
17     $options->{is} ||= 'ro';
18
19     $orig->(@_);
20 };
21
22 __PACKAGE__->meta->make_immutable(
23     inline_constructor => 1,
24     replace_constructor => 1,
25     constructor_name   => "_new",
26 );
27 no Moose;
28
29 1;
30
31 __END__
32
33 =head1 NAME
34
35 MooseX::Role::Parameterized::Meta::Parameter - metaclass for parameters
36
37 =head1 DESCRIPTION
38
39 This is the metaclass for parameter objects, a subclass of
40 L<Moose::Meta::Attribute>. Its sole purpose is to make the default value
41 of the C<is> option C<ro>.
42
43 =cut
44