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