line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
2108
|
use 5.006; |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
308
|
|
2
|
5
|
|
|
5
|
|
37
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
234
|
|
3
|
5
|
|
|
5
|
|
33
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
338
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Metabase::Resource::metabase; |
6
|
|
|
|
|
|
|
our $VERSION = '0.024'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
30
|
use Carp (); |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
106
|
|
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
37
|
use Metabase::Resource; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1469
|
|
11
|
|
|
|
|
|
|
our @ISA = qw/Metabase::Resource/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $hex = '[0-9a-f]'; |
14
|
|
|
|
|
|
|
my $guid_re = qr(\A$hex{8}-$hex{4}-$hex{4}-$hex{4}-$hex{12}\z)i; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _validate_guid { |
17
|
27
|
|
|
27
|
|
43
|
my ( $self, $string ) = @_; |
18
|
27
|
50
|
|
|
|
179
|
if ( $string !~ $guid_re ) { |
19
|
0
|
|
|
|
|
0
|
Carp::confess("'$string' is not formatted as a GUID string"); |
20
|
|
|
|
|
|
|
} |
21
|
27
|
|
|
|
|
68
|
return $string; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _extract_type { |
25
|
27
|
|
|
27
|
|
49
|
my ( $self, $resource ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# determine type |
28
|
27
|
|
|
|
|
135
|
my ($type) = $resource =~ m{\Ametabase:([^:]+)}; |
29
|
27
|
50
|
33
|
|
|
161
|
Carp::confess("could not determine URI type from '$resource'\n") |
30
|
|
|
|
|
|
|
unless defined $type && length $type; |
31
|
27
|
|
|
|
|
106
|
return __PACKAGE__ . "::$type"; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ABSTRACT: class for Metabase resources |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |