line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flickr::Tools::Reflection; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21493
|
use Flickr::API::Reflection; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Types::Standard qw ( InstanceOf ); |
5
|
|
|
|
|
|
|
use Carp; |
6
|
|
|
|
|
|
|
use Moo; |
7
|
|
|
|
|
|
|
use strictures 2; |
8
|
|
|
|
|
|
|
use namespace::clean; |
9
|
|
|
|
|
|
|
use 5.010; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.21_03'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends 'Flickr::Tools'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has '+_api_name' => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => sub { $_[0] =~ m/^Flickr::API::Reflection$/ }, |
19
|
|
|
|
|
|
|
required => 1, |
20
|
|
|
|
|
|
|
default => 'Flickr::API::Reflection', |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub getMethods { |
24
|
|
|
|
|
|
|
my ($self, $args) = @_; |
25
|
|
|
|
|
|
|
my $methods; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
if (defined($args->{list_type}) and $args->{list_type} =~ m/list/i) { |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$methods = $self->{_api}->methods_list; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
else { |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$methods = $self->{_api}->methods_hash; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return $methods; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub thisMethod { |
43
|
|
|
|
|
|
|
my ($self, $args) = @_; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $rsp = {}; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
if (ref($args) eq 'HASH') { |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
if (exists($args->{Method})) { |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$rsp = $self->{_api}->get_method($args->{Method}); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
elsif ($args =~ m/flickr\.[a-z]+\.*/) { |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
$rsp = $self->{_api}->get_method($args); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
else { |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
carp "argument neither a hashref pointing to a method, or the name of a method"; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
return $rsp; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |