diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-30 21:39:28 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-30 21:39:28 +0000 |
commit | 152ca3daf9af86c810a6b4052c96ea91e86d9d4c (patch) | |
tree | c150e1eeeffe6fef5abc1342827823ce0619226c | |
parent | 4edebf11a6eb893a7dea6aedd7565497b8907b6b (diff) | |
parent | f59e3c5e53dbbb3b6aa0fcedbd56f2f3f768e8c9 (diff) | |
download | reaction-152ca3daf9af86c810a6b4052c96ea91e86d9d4c.tar.gz reaction-152ca3daf9af86c810a6b4052c96ea91e86d9d4c.zip |
r4424@www43 (orig r1173): wallacer | 2009-07-30 14:06:53 -0500
branching for action_filter feature in Role::Actions
r4426@www43 (orig r1175): wallacer | 2009-07-30 16:13:22 -0500
added action_filter
r4427@www43 (orig r1176): wallacer | 2009-07-30 16:39:15 -0500
fixed default value
-rw-r--r-- | lib/Reaction/UI/ViewPort/Role/Actions.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm index 6f3cd6a..368330b 100644 --- a/lib/Reaction/UI/ViewPort/Role/Actions.pm +++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm @@ -16,6 +16,15 @@ has action_order => ( isa => 'ArrayRef' ); +has action_filter => ( + isa => 'CodeRef', is => 'ro', + required => '1', lazy => '1', + default => sub { + my $self = shift; + sub { return [keys %{ $self->action_prototypes }] } + } +); + has action_prototypes => ( is => 'ro', isa => 'HashRef', @@ -35,7 +44,7 @@ sub _build_computed_action_order { ($self->has_action_order ? $self->action_order : []), [ keys %{ $self->action_prototypes } ] ); - return $ordered ; + return $self->action_filter->($ordered, $self->model); } sub _build_actions { |