line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Recruit::HotPepper::Budget; |
2
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
124
|
|
3
|
3
|
|
|
3
|
|
34
|
use base qw( WebService::Recruit::HotPepper::Base ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
348
|
|
4
|
3
|
|
|
3
|
|
16
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
1124
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
0
|
|
|
0
|
1
|
0
|
sub url { 'http://api.hotpepper.jp/Budget/V110'; } |
8
|
0
|
|
|
0
|
1
|
0
|
sub force_array { [qw( Budget Error )]; } |
9
|
0
|
|
|
0
|
1
|
0
|
sub elem_class { 'WebService::Recruit::HotPepper::Budget::Element'; } |
10
|
0
|
|
|
0
|
1
|
0
|
sub query_class { 'WebService::Recruit::HotPepper::Budget::Query'; } |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
0
|
36
|
sub query_fields { [qw( |
13
|
|
|
|
|
|
|
key |
14
|
|
|
|
|
|
|
)]; } |
15
|
3
|
|
|
3
|
1
|
34
|
sub root_elem { 'Results'; } |
16
|
|
|
|
|
|
|
sub elem_fields { { |
17
|
3
|
|
|
3
|
0
|
41
|
Results => [qw( |
18
|
|
|
|
|
|
|
NumberOfResults APIVersion |
19
|
|
|
|
|
|
|
Budget |
20
|
|
|
|
|
|
|
)], |
21
|
|
|
|
|
|
|
Budget => [qw( |
22
|
|
|
|
|
|
|
BudgetDesc BudgetCD |
23
|
|
|
|
|
|
|
)], |
24
|
|
|
|
|
|
|
}; } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# __PACKAGE__->mk_query_accessors(); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
@WebService::Recruit::HotPepper::Budget::Query::ISA = qw( Class::Accessor::Fast ); |
29
|
|
|
|
|
|
|
WebService::Recruit::HotPepper::Budget::Query->mk_accessors( @{query_fields()} ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# __PACKAGE__->mk_elem_accessors(); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
@WebService::Recruit::HotPepper::Budget::Element::ISA = qw( Class::Accessor::Children::Fast ); |
34
|
|
|
|
|
|
|
WebService::Recruit::HotPepper::Budget::Element->mk_ro_accessors( root_elem() ); |
35
|
|
|
|
|
|
|
WebService::Recruit::HotPepper::Budget::Element->mk_child_ro_accessors( %{elem_fields()} ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
WebService::Recruit::HotPepper::Budget - HotPepper Web Service "Budget" API |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
use WebService::Recruit::HotPepper; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $api = WebService::Recruit::HotPepper->new(); |
46
|
|
|
|
|
|
|
$api->key( 'xxxxxxxxxxxxxxxx' ); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $res = $api->Budget(); |
49
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $list = $res->root->Budget; |
52
|
|
|
|
|
|
|
foreach my $area ( @$list ) { |
53
|
|
|
|
|
|
|
print "label: ", $area->BudgetDesc, "\n"; |
54
|
|
|
|
|
|
|
print "code: ", $area->BudgetCD, "\n"; |
55
|
|
|
|
|
|
|
print "\n"; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This module is an interface for the C API. |
61
|
|
|
|
|
|
|
It accepts following query parameters to make an request. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $res = $hpp->Budget(); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
C<$hpp> above is an instance of L. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 METHODS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 root |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This returns the root element of the response. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $root = $res->root; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
You can retrieve each element by the following accessors. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
$root->NumberOfResults; |
78
|
|
|
|
|
|
|
$root->APIVersion; |
79
|
|
|
|
|
|
|
$root->Budget->[0]->BudgetDesc; |
80
|
|
|
|
|
|
|
$root->Budget->[0]->BudgetCD; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 xml |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This returns the raw response context itself. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
print $res->xml, "\n"; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 code |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This returns the response status code. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $code = $res->code; # usually "200" when succeeded |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 is_error |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This returns true value when the response has an error. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
L |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 AUTHOR |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Toshimasa Ishibashi L |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This module is unofficial and released by the author in person. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 THANKS TO |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Yusuke Kawasaki L |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
For creating/preparing all the base modules and stuff. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Copyright (c) 2007 Toshimasa Ishibashi. All rights reserved. |
119
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
120
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
1; |