| 1 | package Net::NicoVideo::Content::ThumbInfo; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | $VERSION = '0.28'; | |||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base qw(Net::NicoVideo::Content Class::Accessor::Fast); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | ▶ | use XML::TreePP; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 1 | ▶ | use vars qw(@Members); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 1 | @Members = qw( | |||||||||||
| 13 | video_id | ||||||||||||
| 14 | title | ||||||||||||
| 15 | description | ||||||||||||
| 16 | thumbnail_url | ||||||||||||
| 17 | first_retrieve | ||||||||||||
| 18 | length | ||||||||||||
| 19 | movie_type | ||||||||||||
| 20 | size_high | ||||||||||||
| 21 | size_low | ||||||||||||
| 22 | view_counter | ||||||||||||
| 23 | comment_num | ||||||||||||
| 24 | mylist_counter | ||||||||||||
| 25 | last_res_body | ||||||||||||
| 26 | watch_url | ||||||||||||
| 27 | thumb_type | ||||||||||||
| 28 | embeddable | ||||||||||||
| 29 | no_live_play | ||||||||||||
| 30 | tags | ||||||||||||
| 31 | user_id | ||||||||||||
| 32 | ); | ||||||||||||
| 33 | |||||||||||||
| 34 | 1 | __PACKAGE__->mk_accessors(@Members); | |||||||||||
| 35 | |||||||||||||
| 36 | |||||||||||||
| 37 | # DEPRECATED | ||||||||||||
| 38 | 0 | ▶ | sub is_failure { | ||||||||||
|
Subroutine
is_failure: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 39 | 0 | $_[0]->is_error; | |||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | 0 | ▶ | sub members { # implement | ||||||||||
|
Subroutine
members: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 43 | 0 | my @copy = @Members; | |||||||||||
| 44 | 0 | @copy; | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | 0 | ▶ | sub parse { # implement | ||||||||||
|
Subroutine
parse: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||
| 48 | 0 | my $self = shift; | |||||||||||
| 49 | 0 | ▶ | $self->load($_[0]) if( defined $_[0] ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 50 | |||||||||||||
| 51 | 0 | my $tpp = XML::TreePP->new( force_array => 'tags' ) | |||||||||||
| 52 | ->parse($self->_decoded_content); | ||||||||||||
| 53 | |||||||||||||
| 54 | 0 | ▶ | my $params = $tpp->{nicovideo_thumb_response} || {}; | ||||||||||
|
Condition0%0/2
$tpp->{'nicovideo_thumb_response'} || {}
MC/DC0%0/1
$tpp->{'nicovideo_thumb_response'} || {}
$tpp->{'nicovideo_thumb_response'}
Truth table0%0/2
A
A= $tpp->{'nicovideo_thumb_response'}
| |||||||||||||
| 55 | 0 | ▶ | my $thumb = $params->{thumb} || {}; | ||||||||||
|
Condition0%0/2
$params->{'thumb'} || {}
MC/DC0%0/1
$params->{'thumb'} || {}
$params->{'thumb'}
Truth table0%0/2
A
A= $params->{'thumb'}
| |||||||||||||
| 56 | |||||||||||||
| 57 | 0 | for my $name ( ($self->members) ){ | |||||||||||
| 58 | 0 | ▶ | $self->$name( $thumb->{$name} ) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 59 | if( $self->can($name) ); | ||||||||||||
| 60 | } | ||||||||||||
| 61 | |||||||||||||
| 62 | # status | ||||||||||||
| 63 | 0 | ▶ | my $status = $params->{'-status'} || ''; | ||||||||||
|
Condition0%0/2
$params->{'-status'} || ''
MC/DC0%0/1
$params->{'-status'} || ''
$params->{'-status'}
Truth table0%0/2
A
A= $params->{'-status'}
| |||||||||||||
| 64 | 0 | ▶ | if( lc($status) eq 'ok' ){ | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 65 | 0 | $self->set_status_success; | |||||||||||
| 66 | }else{ | ||||||||||||
| 67 | 0 | $self->set_status_error; | |||||||||||
| 68 | } | ||||||||||||
| 69 | |||||||||||||
| 70 | 0 | return $self; | |||||||||||
| 71 | } | ||||||||||||
| 72 | |||||||||||||
| 73 | |||||||||||||
| 74 | 1 | 1; | |||||||||||
| 75 | __END__ | ||||||||||||