diff options
Diffstat (limited to 'benchmarks/cmop/lib/MOP/Point.pm')
-rw-r--r-- | benchmarks/cmop/lib/MOP/Point.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/benchmarks/cmop/lib/MOP/Point.pm b/benchmarks/cmop/lib/MOP/Point.pm new file mode 100644 index 0000000..12160f7 --- /dev/null +++ b/benchmarks/cmop/lib/MOP/Point.pm @@ -0,0 +1,24 @@ + +package MOP::Point; + +use strict; +use warnings; +use metaclass; + +__PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); +__PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); + +sub new { + my $class = shift; + $class->meta->new_object(@_); +} + +sub clear { + my $self = shift; + $self->x(0); + $self->y(0); +} + +1; + +__END__ |