« lib/Web/ComposableRequest/Role/Cookie.pm
↑ Summary
blib/lib/Web/ComposableRequest/Role/Headers.pm »
| 1 | package Web::ComposableRequest::Role::Compat; | ||
| 2 | |||
| 3 | use Encode qw( decode ); | ||
| 4 | use Web::ComposableRequest::Constants qw( FALSE TRUE ); | ||
| 5 | use Moo::Role; | ||
| 6 | |||
| 7 | requires qw( body_params query_params uri_params ); | ||
| 8 | |||
| 9 | sub args { | ||
| 10 | my $self = shift; | ||
| 11 | |||
| 12 | return $self->uri_params->({ optional => TRUE, scrubber => FALSE }); | ||
| 13 | } | ||
| 14 | |||
| 15 | sub body_parameters { | ||
| 16 | my $self = shift; | ||
| 17 | |||
| 18 | return $self->body_params->({ | ||
| 19 | hashref => FALSE, optional => TRUE, scrubber => FALSE | ||
| 20 | }); | ||
| 21 | } | ||
| 22 | |||
| 23 | sub parameters { | ||
| 24 | my ($self, $options) = @_; | ||
| 25 | |||
| 26 | return { | ||
| 27 | %{$self->query_parameters($options)}, %{$self->body_parameters($options)} | ||
| 28 | }; | ||
| 29 | } | ||
| 30 | |||
| 31 | sub query_parameters { | ||
| 32 | my $self = shift; | ||
| 33 | |||
| 34 | return $self->query_params->({ optional => TRUE, scrubber => FALSE }); | ||
| 35 | } | ||
| 36 | |||
| 37 | use namespace::autoclean; | ||
| 38 | |||
| 39 | 1; | ||
| 40 | |||
| 41 | __END__ |