98ccb8012a4750bf56c7803441bbe654add3b36a
[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 =attr type_constraint
8
9 =cut
10
11 has type_constraint => (
12     is       => 'ro',
13     isa      => 'Moose::Meta::TypeConstraint',
14     required => 1,
15     handles  => [qw/check/],
16 );
17
18 =method name
19
20 =cut
21
22 sub name {
23     my ($self) = @_;
24     return 'slurpy ' . $self->type_constraint->name;
25 }
26
27 no Moose;
28 __PACKAGE__->meta->make_immutable;
29
30 1;