10 with qw/DoesNegated DoesTranspose/;
12 has x => ( isa => 'Int', is => 'rw' );
13 has y => ( isa => 'Int', is => 'rw' );
15 sub inspect { [$_[0]->x, $_[0]->y] }
26 $self->new( x => -$self->x, y => -$self->y );
33 package DoesTranspose;
38 $self->new( x => $self->y, y => $self->x );
44 my $p = Point->new( x => 4, y => 3 );
46 DoesTranspose->meta->apply( $p, -alias => { transpose => 'negated' } );
48 is_deeply($p->negated->inspect, [3, 4]);
49 is_deeply($p->transpose->inspect, [3, 4]);