| 1 | package Form::Sensible::Renderer; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | ## this module provides the basics for rendering of forms / fields | ||||||||||
| 7 | ## | ||||||||||
| 8 | ## should this be an abstract role that defines the interface for rendering? | ||||||||||
| 9 | |||||||||||
| 10 | 54 | ▶ | sub render_hints_for { | ||||||||
|
Subroutine
render_hints_for: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||
| 11 | 54 | my ($self, $renderer_name, $thing) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 54 | my $hints = $thing->render_hints(); | |||||||||
| 14 | |||||||||||
| 15 | 54 | ▶ | if (exists($hints->{$renderer_name})) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | return $hints->{$renderer_name}; | |||||||||
| 17 | } else { | ||||||||||
| 18 | 54 | return $hints; | |||||||||
| 19 | } | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub render { | ||||||||
|
Subroutine
render: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | my ($self, $form) = @_; | |||||||||
| 24 | |||||||||||
| 25 | 0 | die "Unable to render " . $form->name . " because you are trying to use an abstract base class to render."; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||
| 30 | 3 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||