=cut
-use Class::C3;
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 { {} });
-no Moose;
+around BUILDARGS => sub {
+ my ($next, $self, @args) = @_;
+ unshift @args, 'part' if scalar @args == 1 && !ref $args[0];
+ return $self->$next(@args);
+};
-sub new {
- my ($self, $params) = @_;
- $params = { part => $params } unless ref $params;
- $self->next::method($params);
-}
+no Moose;
+use overload (
+ # Stringify to path part for tree search
+ q{""} => sub { shift->part },
+);
sub get_action {
my ( $self, $name ) = @_;
Provided by Moose
-=head1 AUTHOR
+=head1 AUTHORS
-Matt S. Trout
+Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
-This program is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.
=cut