Skip to content

Instantly share code, notes, and snippets.

@deppp
Created November 5, 2009 11:53
Show Gist options
  • Save deppp/226998 to your computer and use it in GitHub Desktop.
Save deppp/226998 to your computer and use it in GitHub Desktop.
package Employee;
use Class::MOP;
use Class::MOP::Class;
use Class::MOP::Attribute;
Class::MOP::Class->create(
'Employee' => (
version => '0.01',
superclasses => ['Person'],
attributes => [
Class::MOP::Attribute->new(
position => (
accessor => 'position',
init_arg => 'position',
default => 'programmer'
)
)
]
)
);
sub new {
my ($class, $args) = @_;
return bless $args, $class;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment