Commit | Line | Data |
---|---|---|
857f87a7 | 1 | |
2 | package MOP::Immutable::Point; | |
3 | ||
4 | use strict; | |
5 | use warnings; | |
6 | use metaclass; | |
7 | ||
c0cbf4d9 | 8 | __PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); |
857f87a7 | 9 | __PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); |
10 | ||
857f87a7 | 11 | sub clear { |
12 | my $self = shift; | |
13 | $self->x(0); | |
14 | $self->y(0); | |
15 | } | |
16 | ||
17 | __PACKAGE__->meta->make_immutable; | |
18 | ||
19 | 1; | |
20 | ||
1d9507b6 | 21 | __END__ |