Skip to content

Instantly share code, notes, and snippets.

@rsimoes
Created June 17, 2013 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsimoes/5799805 to your computer and use it in GitHub Desktop.
Save rsimoes/5799805 to your computer and use it in GitHub Desktop.
package Foo;
use Moo::Role;
use MooX::ClassAttribute;
class_has 'foo' => (
is => 'ro',
isa => sub { $_[0] == 1 or die 'not 1' }
);
package Bar;
use Moo;
use MooX::ClassAttribute;
with 'Foo';
class_has '+foo' => (
default => 1
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment