Make overflow type constraints introspectable and the name of constraints using them...
[gitmo/MooseX-Types-Structured.git] / lib / MooseX / Types / Structured / OverflowHandler.pm
1 package MooseX::Types::Structured::OverflowHandler;
2
3 use Moose;
4
5 use overload '""' => 'name', fallback => 1;
6
7 has type_constraint => (
8     is       => 'ro',
9     isa      => 'Moose::Meta::TypeConstraint',
10     required => 1,
11     handles  => [qw/check/],
12 );
13
14 sub name {
15     my ($self) = @_;
16     return 'slurpy ' . $self->type_constraint->name;
17 }
18
19 no Moose;
20 __PACKAGE__->meta->make_immutable;
21
22 1;