| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Ark::Request; | 
| 2 | 62 |  |  | 62 |  | 119735 | use Mouse; | 
|  | 62 |  |  |  |  | 29246 |  | 
|  | 62 |  |  |  |  | 337 |  | 
| 3 |  |  |  |  |  |  |  | 
| 4 |  |  |  |  |  |  | extends 'Plack::Request::WithEncoding'; | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 62 |  |  | 62 |  | 48610 | use Path::AttrRouter::Match; | 
|  | 62 |  |  |  |  | 98410 |  | 
|  | 62 |  |  |  |  | 3719 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | has match => ( | 
| 9 |  |  |  |  |  |  | is      => 'rw', | 
| 10 |  |  |  |  |  |  | isa     => 'Path::AttrRouter::Match', | 
| 11 |  |  |  |  |  |  | handles => [qw/action args captures/], | 
| 12 |  |  |  |  |  |  | ); | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | { | 
| 15 | 62 |  |  | 62 |  | 900 | no warnings 'once'; | 
|  | 62 |  |  |  |  | 144 |  | 
|  | 62 |  |  |  |  | 3479 |  | 
| 16 |  |  |  |  |  |  | *arguments = \&args; | 
| 17 |  |  |  |  |  |  | } | 
| 18 |  |  |  |  |  |  |  | 
| 19 | 62 |  |  | 62 |  | 414 | no Mouse; | 
|  | 62 |  |  |  |  | 124 |  | 
|  | 62 |  |  |  |  | 268 |  | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | # for backward compatible | 
| 22 |  |  |  |  |  |  | sub wrap { | 
| 23 | 0 |  |  | 0 | 0 | 0 | my ($class, $req) = @_; | 
| 24 |  |  |  |  |  |  |  | 
| 25 | 0 |  |  |  |  | 0 | warn 'Ark::Request#wrap is deprecated. use new() directory instead'; | 
| 26 | 0 |  |  |  |  | 0 | return $class->new( $req->env ); | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | sub uri { | 
| 30 | 1 |  |  | 1 | 1 | 2025 | my $self = shift; | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 1 |  | 33 |  |  | 15 | $self->{uri} ||= $self->SUPER::uri; | 
| 33 | 1 |  |  |  |  | 8100 | $self->{uri}->clone; # avoid destructive opearation | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | sub base { | 
| 37 | 11 |  |  | 11 | 1 | 1359 | my $self = shift; | 
| 38 |  |  |  |  |  |  |  | 
| 39 | 11 |  | 33 |  |  | 99 | $self->{base} ||= $self->SUPER::base; | 
| 40 | 11 |  |  |  |  | 1994 | $self->{base}->clone; # avoid destructive operation | 
| 41 |  |  |  |  |  |  | } | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | sub uri_with { | 
| 44 | 0 |  |  | 0 | 0 |  | my ($self, $args) = @_; | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 0 |  |  |  |  |  | my $uri = $self->uri; | 
| 47 |  |  |  |  |  |  |  | 
| 48 | 0 |  |  |  |  |  | my %params = $uri->query_form; | 
| 49 | 0 |  |  |  |  |  | while (my ($k, $v) = each %$args) { | 
| 50 | 0 |  |  |  |  |  | $params{$k} = $v; | 
| 51 |  |  |  |  |  |  | } | 
| 52 | 0 |  |  |  |  |  | $uri->query_form(%params); | 
| 53 |  |  |  |  |  |  |  | 
| 54 | 0 |  |  |  |  |  | return $uri; | 
| 55 |  |  |  |  |  |  | } | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | 1; |