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