RW
[gitmo/MooseX-HasDefaults.git] / lib / MooseX / IsDefaults / Meta / IsRW.pm
CommitLineData
253cd18c 1package MooseX::IsDefaults::Meta::IsRW;
2use Moose::Role;
3
4# This does not actually do anything but lie less in the attribute's metadata.
5has '+is' => (
6 default => 'rw',
7);
8
9around _process_options => sub {
10 my $orig = shift;
11 my (undef, undef, $options) = @_;
12
13 if (!exists($options->{is})) {
14 $options->{is} = 'rw';
15 }
16 # They want no accessor, but Moose doesn't like "is => undef"
17 elsif (!defined($options->{is})) {
18 delete $options->{is};
19 }
20
21 $orig->(@_);
22};
23
241;
25