Class/YahooChiebukuro.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
init
2.0
question_search
2.0
category_tree
2.0
CRAP 2.0
1 package WebService::Class::YahooChiebukuro;
2 use strict;
3 use utf8;
4 use base qw(WebService::Class::AbstractHTTPRequestClass);
5 __PACKAGE__->mk_accessors(qw(appid));
6 __PACKAGE__->base_url('http://chiebukuro.yahooapis.jp/Chiebukuro/V1/');
7  
8 sub init{
9 my $self = shift;
10 my %args = @_;
11 $self->SUPER::init(@_);
12 $self->appid($args{'appid'});
13 $self->urls({
14 'question_search' => $self->base_url.'questionSearch',
15 'category_tree' => $self->base_url.'categoryTree',
16 });
17 }
18  
19  
20 sub question_search{
21 my $self = shift;
22 my $keyword = shift;
23 my $args = shift;
24 $args->{keyword}=$keyword;
25 $args->{appid}=$self->appid;
26 $self->request_api()->request('GET',$self->urls()->{'question_search'},$args,{})->parse_xml();
27 }
28  
29  
30 sub category_tree{
31 my $self = shift;
32 my $categoryid = shift;
33 my $args = {
34 appid=>$self->appid,
35 categoryid=>$categoryid
36 };
37 $self->request_api()->request('GET',$self->urls()->{'category_tree'},$args,{})->parse_xml();
38 }
39  
40  
41  
42 1;