line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Badger::Data::Facet::Class; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
18
|
use Carp; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
225
|
|
4
|
3
|
|
|
3
|
|
32
|
use Badger::Data::Facets; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
use Badger::Class |
6
|
3
|
|
|
|
|
43
|
version => 0.01, |
7
|
|
|
|
|
|
|
debug => 0, |
8
|
|
|
|
|
|
|
uber => 'Badger::Class', |
9
|
|
|
|
|
|
|
utils => 'camel_case', |
10
|
|
|
|
|
|
|
constants => 'DELIMITER ARRAY', |
11
|
|
|
|
|
|
|
constant => { |
12
|
|
|
|
|
|
|
FACETS => 'Badger::Data::Facets', |
13
|
|
|
|
|
|
|
FACET => 'Badger::Data::Facet', |
14
|
|
|
|
|
|
|
}, |
15
|
|
|
|
|
|
|
hooks => { |
16
|
|
|
|
|
|
|
type => \&type, |
17
|
|
|
|
|
|
|
args => \&args, |
18
|
|
|
|
|
|
|
opts => \&opts, |
19
|
3
|
|
|
3
|
|
27
|
}; |
|
3
|
|
|
|
|
6
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub type { |
23
|
10
|
|
|
10
|
1
|
19
|
my ($self, $type) = @_; |
24
|
10
|
|
33
|
|
|
51
|
my $facet = $self->FACETS->prototype->find($type) |
25
|
|
|
|
|
|
|
|| croak "Invalid facet type: $type\n"; |
26
|
10
|
|
|
|
|
46
|
$self->base($facet); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub args { |
31
|
10
|
|
|
10
|
1
|
29
|
my ($self, $args) = @_; |
32
|
|
|
|
|
|
|
|
33
|
10
|
50
|
|
|
|
65
|
$args = [ split(DELIMITER, $args) ] |
34
|
|
|
|
|
|
|
unless ref $args eq ARRAY; |
35
|
|
|
|
|
|
|
|
36
|
10
|
|
|
|
|
59
|
$self->var( ARGS => $args ); |
37
|
10
|
|
|
|
|
36
|
$self->mutators($args); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub opts { |
42
|
0
|
|
|
0
|
1
|
|
my ($self, $opts) = @_; |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
$opts = [ split(DELIMITER, $opts) ] |
45
|
|
|
|
|
|
|
unless ref $opts eq ARRAY; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
$self->var( OPTS => $opts ); |
48
|
0
|
|
|
|
|
|
$self->mutators($opts); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |