| 1 | package Type::Tiny::_HalfOp; | ||
| 2 | |||
| 3 | use 5.008001; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | BEGIN { | ||
| 8 | $Type::Tiny::_HalfOp::AUTHORITY = 'cpan:TOBYINK'; | ||
| 9 | $Type::Tiny::_HalfOp::VERSION = '2.010001'; | ||
| 10 | } | ||
| 11 | |||
| 12 | $Type::Tiny::_HalfOp::VERSION =~ tr/_//d; | ||
| 13 | |||
| 14 | sub new { | ||
| 15 | my ( $class, $op, $param, $type ) = @_; | ||
| 16 | bless { | ||
| 17 | op => $op, | ||
| 18 | param => $param, | ||
| 19 | type => $type, | ||
| 20 | }, $class; | ||
| 21 | } | ||
| 22 | |||
| 23 | sub complete { | ||
| 24 | require overload; | ||
| 25 | my ( $self, $type ) = @_; | ||
| 26 | my $complete_type = $type->parameterize( @{ $self->{param} } ); | ||
| 27 | my $method = overload::Method( $complete_type, $self->{op} ); | ||
| 28 | $complete_type->$method( $self->{type}, undef ); | ||
| 29 | } | ||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ |