« Articulate/Serialisation/SiteConfig.pm
↑ Summary
Articulate/Augmentation/Interpreter/Markdown.pm »
| 1 | package Articulate::Routes::Transparent; | ||
| 2 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 5 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | with 'Articulate::Role::Routes'; | |
| 7 | 5 | ▶ | use Articulate::Syntax::Routes; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 5 | ▶ | use Articulate::Service; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | get '/zone/:zone_id/article/:article_id' => sub { | ||
| 11 | 0 | ▶ | my ( $self, $request ) = @_; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 12 | 0 | my $zone_id = $request->params->{'zone_id'}; | |
| 13 | 0 | my $article_id = $request->params->{'article_id'}; | |
| 14 | 0 | $self->service->process_request( | |
| 15 | read => { | ||
| 16 | location => "zone/$zone_id/article/$article_id", | ||
| 17 | } | ||
| 18 | ); | ||
| 19 | 5 | }; | |
| 20 | |||
| 21 | post '/zone/:zone_id/article/:article_id' => sub { | ||
| 22 | 0 | ▶ | my ( $self, $request ) = @_; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 23 | 0 | my $zone_id = $request->params->{'zone_id'}; | |
| 24 | 0 | my $article_id = $request->params->{'article_id'}; | |
| 25 | 0 | my $content = $request->params->{'content'}; | |
| 26 | 0 | $self->service->process_request( | |
| 27 | create => { | ||
| 28 | location => "zone/$zone_id/article/$article_id", | ||
| 29 | content => $content, | ||
| 30 | } | ||
| 31 | ); | ||
| 32 | 5 | }; | |
| 33 | |||
| 34 | post '/zone/:zone_id/article/:article_id/edit' => sub { | ||
| 35 | 0 | ▶ | my ( $self, $request ) = @_; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 36 | 0 | my $zone_id = $request->params->{'zone_id'}; | |
| 37 | 0 | my $article_id = $request->params->{'article_id'}; | |
| 38 | 0 | my $content = $request->params->{'content'}; | |
| 39 | 0 | $self->service->process_request( | |
| 40 | update => { | ||
| 41 | location => "zone/$zone_id/article/$article_id", | ||
| 42 | content => $content, | ||
| 43 | } | ||
| 44 | ); | ||
| 45 | 5 | }; | |
| 46 | |||
| 47 | 5 | 1; | |