line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Cloudstack::Base; |
2
|
2
|
|
|
2
|
|
10
|
use Mojo::Base -base; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
17
|
|
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
|
2
|
|
|
2
|
|
521
|
no strict 'refs'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
258
|
|
11
|
0
|
|
|
|
|
|
*{ "${cs_class}::import" } = *{ "Mojo::Base::import" }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
*{ "${cs_class}::attr" } = *{ "Mojo::Base::attr" }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
15
|
use strict 'refs'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
513
|
|
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__ |