CatalystX-Declare

 view release on metacpan or  search on metacpan

lib/CatalystX/Declare/Keyword/Action.pm  view on Meta::CPAN

    }

    method _build_flag_populator (Object $ctx, HashRef $attrs, Str $what) {

        $attrs->{Private} = []
            if $what eq 'private';

        return sub {
            my $method = shift;

            if ($what eq any qw( end endpoint final )) {
                $attrs->{Args} = delete $attrs->{CaptureArgs};
            }
            elsif ($what eq 'private') {
                $attrs->{Private} = [];
            }
        };
    }

    method _handle_under_option (Object $ctx, HashRef $attrs) {

lib/CatalystX/Declare/Keyword/Action.pm  view on Meta::CPAN

    
            my $chars = $ctx->stash->{chars};
            ...
        }


        # you can use a shortcut for multiple actions with
        # a common base
        under base {

            # this is an endpoint after base
            action normal is final;

            # the final keyword can be used to be more 
            # visually explicit about end-points
            final action some_action { ... }

            # type dispatching works
            final action with_str (Str $x) as via_type;
            final action with_int (Int $x) as via_type;
        }



( run in 0.285 second using v1.01-cache-2.11-cpan-27979f6cc8f )