=cut
use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
-use overload (
-
- # Stringify to path part for tree search
- q{""} => sub { shift->part },
-
-);
-
-has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
+has part => (is => 'rw', required => 1);
has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
-around 'new' => sub {
- my $next = shift;
- my ($self, $params) = @_;
- $params = { part => $params } unless ref $params;
- $next->($self, $params);
+around new => sub {
+ my ($orig, $self, $params) = @_;
+ $orig->($self, (ref($params) ? $params : { part => $params } ));
};
no Moose;
+use overload (
+ # Stringify to path part for tree search
+ q{""} => sub { shift->part },
+);
+
sub get_action {
my ( $self, $name ) = @_;
return $self->actions->{$name} if defined $self->actions->{$name};
Provided by Moose
-=head1 AUTHOR
+=head1 AUTHORS
-Matt S. Trout
+Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT