
package Moose::Policy::FollowPBP;

use constant attribute_metaclass => 'Moose::Policy::FollowPBP::Attribute';

package Moose::Policy::FollowPBP::Attribute;
use Moose;

extends 'Moose::Meta::Attribute';

before '_process_options' => sub {
    my ($class, $name, $options) = @_;
    # NOTE:
    # If is has been specified, and 
    # we don't have a reader or writer
    # Of couse this is an odd case, but
    # we better test for it anyway.
    if (exists $options->{is} && !(exists $options->{reader} || exists $options->{writer})) {
        if ($options->{is} eq 'ro') {
            $options->{reader} = 'get_' . $name;
        }
        elsif ($options->{is} eq 'rw') {
            $options->{reader} = 'get_' . $name;
            $options->{writer} = 'set_' . $name;
        }
        delete $options->{is};
    }
};

1;

__END__

=pod

=cut
