| 1 | package HTTP::Engine::Middleware::MobileAttribute; | ||||||||||||||||||||
| 2 | 1 | ▶ | use HTTP::Engine::Middleware; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use HTTP::MobileAttribute; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | { | ||||||||||||||||||||
| 6 | 1 | my $req; | |||||||||||||||||||
| 7 | my $mobile_attribute; | ||||||||||||||||||||
| 8 | middleware_method 'mobile_attribute' => sub { | ||||||||||||||||||||
| 9 | 2 | ▶ | return unless $req; | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=13.1
Branch: 1 branch
| |||||||||||||||||||||
| 10 | 2 | ▶ | $mobile_attribute ||= HTTP::MobileAttribute->new( $req->headers ); | ||||||||||||||||||
|
Condition33%1/3
$mobile_attribute ||= "HTTP::MobileAttribute"->new($req->headers)
MC/DC0%0/2
$mobile_attribute ||= "HTTP::MobileAttribute"->new($req->headers)
$mobile_attribute
"HTTP::MobileAttribute"->new($req->headers)
Truth table33%1/3
A ||= B
A= $mobile_attributeB= "HTTP::MobileAttribute"->new($req->headers)
| |||||||||||||||||||||
| 11 | 1 | }; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | before_handle { | ||||||||||||||||||||
| 14 | 2 | ▶ | (undef, undef, $req) = @_; | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | 2 | $mobile_attribute = undef; | |||||||||||||||||||
| 16 | 2 | $req; | |||||||||||||||||||
| 17 | 1 | }; | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | __MIDDLEWARE__ | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 1 | __END__ | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | =head1 NAME | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | HTTP::Engine::Middleware::MobileAttribute - wrapper for HTTP::MobileAttribute | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | =head1 SYNOPSIS | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | my $mw = HTTP::Engine::Middleware->new({method_class => 'HTTP::Engine::Request'}); | ||||||||||||||||||||
| 31 | $mw->install(qw/ HTTP::Engine::Middleware::MobileAttribute /); | ||||||||||||||||||||
| 32 | HTTP::Engine->new( | ||||||||||||||||||||
| 33 | interface => { | ||||||||||||||||||||
| 34 | module => 'YourFavoriteInterfaceHere', | ||||||||||||||||||||
| 35 | request_handler => $mw->handler( \&handler ), | ||||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | )->run(); | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | =head1 DESCRIPTION | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | This module injects one method named 'mobile_attribute'. | ||||||||||||||||||||
| 42 | This method returns the instance of HTTP::MobileAttribute. | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | =head1 AUTHORS | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | Tokuhiro Matsuno | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | =head1 SEE ALSO | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | L<HTTP::MobileAttribute> | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | =cut | ||||||||||||||||||||