line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Cloudstack::Base; |
2
|
1
|
|
|
1
|
|
5
|
use Mojo::Base -base; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
sub new { |
5
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
6
|
0
|
|
|
|
|
|
my $cs_class = shift; |
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
|
|
|
my $self = bless shift, $cs_class; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
201
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
113
|
|
11
|
0
|
|
|
|
|
|
*{ "${cs_class}::import" } = *{ "Mojo::Base::import" }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
*{ "${cs_class}::attr" } = *{ "Mojo::Base::attr" }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
273
|
|
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
$self->import('-base'); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
foreach my $key (keys %$self) { |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$self->attr( |
20
|
|
|
|
|
|
|
$key => sub { |
21
|
0
|
|
|
0
|
|
|
my ($self, $value) = @_; |
22
|
0
|
0
|
0
|
|
|
|
return $value ? (($self->{ $key } = $value) and $self) : $self->{ $key }; |
23
|
|
|
|
|
|
|
} |
24
|
0
|
|
|
|
|
|
); |
25
|
0
|
0
|
|
|
|
|
if ($key eq 'jobresult') { |
26
|
0
|
|
|
|
|
|
my $otype = (keys %{ $self->{ jobresult } })[0]; |
|
0
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$self->$key(Mojo::Cloudstack::Base->new('Mojo::Cloudstack::' . ucfirst ($otype), $self->{ $key }{ $otype })); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |