| 1 | package Form::Sensible::Field::Trigger; | ||
| 2 | |||
| 3 | 16 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 16 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 16 | extends 'Form::Sensible::Field'; | |
| 6 | |||
| 7 | ## provides an action trigger | ||
| 8 | |||
| 9 | ## always has an activation trigger, even if it does nothing. | ||
| 10 | |||
| 11 | 16 | has 'event_to_trigger' => ( | |
| 12 | is => 'rw', | ||
| 13 | isa => 'Str', | ||
| 14 | required => 1, | ||
| 15 | builder => '_default_event_name', | ||
| 16 | lazy => 1, | ||
| 17 | ); | ||
| 18 | |||
| 19 | 1 | ▶ | sub _default_event_name { |
|
Subroutine
_default_event_name: called CC=1 SCAR=0.0
| |||
| 20 | 1 | my ($self) = @_; | |
| 21 | |||
| 22 | 1 | return $self->name . "_triggered"; | |
| 23 | } | ||
| 24 | |||
| 25 | |||
| 26 | 1 | ▶ | sub get_additional_configuration { |
|
Subroutine
get_additional_configuration: called CC=1 SCAR=0.0
Pod
documented
| |||
| 27 | 1 | my $self = shift; | |
| 28 | |||
| 29 | return { | ||
| 30 | 1 | 'event_to_trigger' => $self->event_to_trigger, | |
| 31 | }; | ||
| 32 | |||
| 33 | } | ||
| 34 | |||
| 35 | 16 | __PACKAGE__->meta->make_immutable; | |
| 36 | 16 | 1; | |
| 37 | |||
| 38 | __END__ | ||