{
package Eq;
- use strict;
- use warnings;
use Moose::Role;
requires 'equal_to';
}
package Comparable;
- use strict;
- use warnings;
use Moose::Role;
with 'Eq';
}
package Printable;
- use strict;
- use warnings;
use Moose::Role;
requires 'to_string';
{
package US::Currency;
- use strict;
- use warnings;
use Moose;
with 'Comparable', 'Printable';
my $self = shift;
sprintf '$%0.2f USD' => $self->amount
}
+
+ __PACKAGE__->meta->make_immutable(debug => 0);
}
ok(US::Currency->does('Comparable'), '... US::Currency does Comparable');