line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mobile::WURFL::Device; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
19433
|
use 5.008004; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
95
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use base 'Mobile::WURFL::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
511
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
11
|
|
|
|
|
|
|
our $AUTOLOAD; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $args = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
confess "missing data at initialization\n" unless defined $args->{device_data}; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
$self->device_data( $args->{device_data} ); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub device_data { |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
0
|
0
|
|
$_[0]->{'device_data'} = $_[1] if @_ > 1; |
28
|
0
|
|
|
|
|
|
$_[0]->{'device_data'}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _attribute { |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
|
|
$_[0]->device_data->{attributes}{ $_[1] }; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _list_attributes { |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
|
|
sort keys %{ $_[0]->device_data->{ attributes } }; |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _capability { |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
|
|
$_[0]->device_data->{capabilities}{ $_[1] }; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _list_capabilities { |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
|
|
sort keys %{ $_[0]->device_data->{ capabilities } }; |
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub AUTOLOAD { |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
|
|
my $method = (split /::/, $AUTOLOAD)[ -1 ]; |
54
|
0
|
0
|
|
|
|
|
return if $method eq 'DESTROY'; |
55
|
|
|
|
|
|
|
|
56
|
0
|
0
|
|
|
|
|
if (defined $_[0]->device_data->{capabilities}{$method}) { |
57
|
0
|
|
|
|
|
|
return $_[0]->device_data->{capabilities}{$method}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
confess "method '$method' not found\n"; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
__END__ |