Add help_text as an exposed method
Tomas Doran [Tue, 27 Sep 2011 14:45:01 +0000 (15:45 +0100)]
lib/CatalystX/HelpText/Role/HelpText.pm

index 1ff495e..bc29848 100644 (file)
@@ -2,6 +2,14 @@ package CatalystX::HelpText::Role::HelpText;
 use Moose::Role;
 use Try::Tiny;
 
+requires 'expose_methods';
+
+around expose_methods => sub {
+    my ($orig, $self, @args) = @_;
+    my @m = $self->$orig(@args)->flatten;
+    [ @m, 'help_text' ];
+};
+
 sub help_text {
     my ($self, $c, $key) = @_;
     try {
@@ -13,4 +21,4 @@ sub help_text {
     };
 }
 
-1;
\ No newline at end of file
+1;