From da928b59285b96179db5cecd1325efe3aff1e93b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 1 Jun 2009 02:51:02 -0500 Subject: allow specifying a type constraint name instead of a coderef as a formatter --- lib/Bot/Games/Trait/Method/Formatted.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Bot/Games/Trait/Method/Formatted.pm') diff --git a/lib/Bot/Games/Trait/Method/Formatted.pm b/lib/Bot/Games/Trait/Method/Formatted.pm index 0145bea..7e0b986 100644 --- a/lib/Bot/Games/Trait/Method/Formatted.pm +++ b/lib/Bot/Games/Trait/Method/Formatted.pm @@ -10,6 +10,13 @@ has formatter => ( } }, ); +sub _munge_formatter { + my $self = shift; + my ($format) = @_; + return $format if ref($format) eq 'CODE'; + return $self->associated_metaclass->formatter_for($format); +} + no Moose::Role; 1; -- cgit v1.2.3-54-g00ecf