package Three;

use Moose;

my $called_foo = 0;

sub get_called_foo { $called_foo }

has foo => (is => 'rw', required => 1 );

sub BUILD {
    my $self = shift;
    $self->foo(42);
}

#before foo => sub {
#    my ($self, $val) = @_;
#    $called_foo++ if $val;
#};

__PACKAGE__->meta->make_immutable;

1;
