Created
December 3, 2011 03:59
-
-
Save stevan/1425974 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Moose; | |
use Class::MOP::Attribute; | |
use Class::MOP::Class; | |
use Data::Dumper; | |
my $ass = Class::MOP::Class->create( | |
'FooBarski' => ( | |
version => '0.01', | |
) | |
); | |
print Dumper($ass); | |
$ass->make_mutable; | |
print $ass->is_mutable."\n"; | |
$ass->add_attribute(Class::MOP::Attribute->new( | |
foo => ( | |
accessor => 'foo', | |
default => 'Hello World' | |
) | |
)); | |
my $foo = $ass->new_object; | |
print $foo->foo."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment