line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!perl |
2
|
|
|
|
|
|
|
#PODNAME: Raisin::Entity::Object |
3
|
|
|
|
|
|
|
#ABSTRACT: An expose object. |
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
118750
|
use strict; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
254
|
|
6
|
9
|
|
|
9
|
|
41
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
483
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Raisin::Entity::Object; |
9
|
|
|
|
|
|
|
$Raisin::Entity::Object::VERSION = '0.94'; |
10
|
9
|
|
|
|
|
71
|
use Plack::Util::Accessor qw( |
11
|
|
|
|
|
|
|
desc |
12
|
|
|
|
|
|
|
name |
13
|
|
|
|
|
|
|
runtime |
14
|
|
|
|
|
|
|
using |
15
|
9
|
|
|
9
|
|
737
|
); |
|
9
|
|
|
|
|
480
|
|
16
|
9
|
|
|
9
|
|
562
|
use Types::Standard qw(Any ArrayRef HashRef); |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
64
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
50
|
|
|
50
|
0
|
15753
|
my ($class, $name, @params) = @_; |
20
|
|
|
|
|
|
|
|
21
|
50
|
100
|
66
|
|
|
215
|
if (scalar(@params) % 2 && ref($params[-1]) eq 'CODE') { |
22
|
6
|
|
|
|
|
22
|
splice @params, -1, 0, 'runtime'; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
50
|
|
|
|
|
233
|
bless { name => $name, @params }, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
4
|
1
|
10
|
sub required { 1 } |
29
|
44
|
|
|
44
|
1
|
161
|
sub alias { shift->{as} } |
30
|
28
|
|
|
28
|
1
|
133
|
sub condition { shift->{if} } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub type { |
33
|
9
|
|
|
9
|
1
|
22
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
9
|
|
|
|
|
13
|
my $type = do { |
36
|
9
|
100
|
|
|
|
31
|
if ($self->{type}) { |
|
|
100
|
|
|
|
|
|
37
|
5
|
|
|
|
|
26
|
$self->{type}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
elsif ($self->using) { |
40
|
2
|
|
|
|
|
15
|
ArrayRef[HashRef]; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
else { |
43
|
2
|
|
|
|
|
13
|
Any; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
|
47
|
9
|
|
|
|
|
209
|
$type; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub display_name { |
51
|
39
|
|
|
39
|
1
|
83
|
my $self = shift; |
52
|
39
|
100
|
|
|
|
87
|
$self->alias || $self->name; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |