aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Role/Actions.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-24 02:26:09 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-24 02:26:09 +0000
commit91140599186e2a589b4a4a9aa5d2d441fbdd0aee (patch)
treee7fef9e08879ded3abc75809cafa05707f7b2156 /lib/Reaction/UI/ViewPort/Role/Actions.pm
parentb3cb974ab4d6b77298676cc633af490bb136ace5 (diff)
downloadreaction-91140599186e2a589b4a4a9aa5d2d441fbdd0aee.tar.gz
reaction-91140599186e2a589b4a4a9aa5d2d441fbdd0aee.zip
more POD
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Role/Actions.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Role/Actions.pm36
1 files changed, 33 insertions, 3 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm
index 1731a7e..f1f731c 100644
--- a/lib/Reaction/UI/ViewPort/Role/Actions.pm
+++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm
@@ -76,7 +76,7 @@ A role to ease attaching actions to L<Reaction::InterfaceModel::Object>s
=head2 actions
-Automatically built ArrayRef of URI objects pointing to actions
+Read-only, lazy-building ArrayRef of URI objects pointing to actions.
=head2 action_prototypes
@@ -108,8 +108,38 @@ User-provided ArrayRef with how the actions should be ordered eg
=head2 computed_action_order
-The final computed action order. This may differ from the action_order provided
-if you didn't list all of the actions in that.
+Read-only lazy-building ARRAY ref. The final computed action order. This may
+differ from the C<action_order> provided if you any actions were not included
+in that list.
+
+=head1 METHODS
+
+=head2 _build_actions
+
+Cycle through the C<computed_action_order> and create a new
+L<ViewPort::URI|Reaction::UI::ViewPort::URI> object for each action using the
+provided prototypes.
+
+=head2 _build_computed_action_order
+
+Compute the final action ordering by using the provided C<action_order> as a
+spec to order all the present actions (the keys of C<action_prototypes>)
+
+=head1 ACTION PROTOTYPES
+
+Action prototypes are simply hashrefs that must contain a C<uri> key and may
+contain a C<label> key. The label can be anything that the display attribute of
+L<ViewPort::URI|Reaction::UI::ViewPort::URI> will accept, usually a scalar or a
+ViewPort. The value for C<uri> may be either a scalar, a L<URI> object (or
+anything that C<ISA URI>).
+
+Additionally, both C<label> and C<uri> can be CODE refs. In this case, the code
+will be executed at C<_build_actions> time and will recieve two arguments, the
+value returned by C<model> and the value returned by C<ctx> in that order. Both
+of these methods should be implemented in the consuming class. By convention,
+model refers to the target of the action, an C<InterfaceModel::Object> in the
+case of a member action and an C<InterfaceModel::Collection> in the case of a
+Collection action. C<ctx> should be the current Catalyst context.
=head1 AUTHORS