| 1 | # $Id: Runtime.pm 7370 2012-04-09 01:17:33Z chris $ | ||||||||||
| 2 | |||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | WebService::IMDB::Runtime | ||||||||||
| 6 | |||||||||||
| 7 | =cut | ||||||||||
| 8 | |||||||||||
| 9 | package WebService::IMDB::Runtime; | ||||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 2 | our $VERSION = '0.05'; | |||||||||
| 15 | |||||||||||
| 16 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 2 | our @CARP_NOT = qw(WebService::IMDB WebService::IMDB::Title); | |||||||||
| 18 | |||||||||||
| 19 | 2 | ▶ | use DateTime::Duration; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub _new { | ||||||||
|
Subroutine
_new: not called CC=3 SCAR=24.8
| |||||||||||
| 23 | 0 | my $class = shift; | |||||||||
| 24 | 0 | my $ws = shift; | |||||||||
| 25 | 0 | ▶ | my $data = shift or die; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | if (exists $data->{'time'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | return DateTime::Duration->new('seconds' => $data->{'time'}); | |||||||||
| 29 | |||||||||||
| 30 | } else { | ||||||||||
| 31 | 0 | croak "Unable to parse runtime"; | |||||||||
| 32 | } | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 2 | 1; | |||||||||