Skip to content

@j1n3l0 /gist:2158368
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
only accept hashrefs as arguments #moose #perl
{ package Foo;
use Moose;
has bar => qw( is ro required 1 );
around BUILDARGS => sub {
my ( $orig, $class, @args ) = @_;
unless ( @args == 1 && ref $args[0] eq 'HASH' ) {
die "arguments must be a hash reference";
}
return $class->$orig(@args);
};
no Moose;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.