formatting changes only. no actual functionality difference
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Role / Actions.pm
CommitLineData
ddccc6a2 1package Reaction::UI::ViewPort::Role::Actions;
b8faba69 2
3use Reaction::Role;
ddccc6a2 4use Reaction::UI::ViewPort::Action::Link;
b8faba69 5
81393881 6use namespace::clean -except => [ qw(meta) ];
7
8
9has actions => (is => 'ro', isa => 'ArrayRef', lazy_build => 1);
10has action_prototypes => (is => 'ro', isa => 'ArrayRef', lazy_build => 1);
11sub _build_action_prototypes { [] };
12sub _build_actions {
13 my ($self) = @_;
14 my (@act, $i);
15 my $ctx = $self->ctx;
16 my $loc = $self->location;
17 foreach my $proto (@{ $self->action_prototypes }) {
18 my $action = Reaction::UI::ViewPort::Action::Link->new
19 (
20 ctx => $ctx,
21 target => $self->model,
22 location => join ('-', $loc, 'action', $i++),
23 %$proto,
24 );
25 push(@act, $action);
26 }
27 return \@act;
b8faba69 28};
29
81393881 30
31
b8faba69 321;
2dba7201 33
34__END__;
35
36=head1 NAME
37
38Reaction::UI::ViewPort::Role::Actions
39
40=head1 DESCRIPTION
41
42A role to ease attaching actions to L<Reaction::InterfaceModel::Object>s
43
44=head1 ATTRIBUTES
45
46=head2 actions
47
48=head2 action_prototypes
49
50=head1 AUTHORS
51
52See L<Reaction::Class> for authors.
53
54=head1 LICENSE
55
56See L<Reaction::Class> for the license.
57
58=cut