| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MooX::Types::SetObject; |
|
2
|
1
|
|
|
1
|
|
35536
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
43
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings FATAL => 'all'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
40
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use MooX::Types::MooseLike qw(exception_message); |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
36
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use Scalar::Util; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Exporter 5.57 'import'; |
|
|
1
|
|
|
|
|
32
|
|
|
|
1
|
|
|
|
|
240
|
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = (); |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $type_definitions = [ |
|
12
|
|
|
|
|
|
|
{ |
|
13
|
|
|
|
|
|
|
name => 'SetObject', |
|
14
|
|
|
|
|
|
|
test => sub { |
|
15
|
|
|
|
|
|
|
require Scalar::Util; |
|
16
|
|
|
|
|
|
|
defined $_[0] and |
|
17
|
|
|
|
|
|
|
Scalar::Util::blessed($_[0]) and $_[0]->isa("Set::Object"); |
|
18
|
|
|
|
|
|
|
}, |
|
19
|
|
|
|
|
|
|
message => sub { return exception_message($_[0], 'a Set::Object') }, |
|
20
|
|
|
|
|
|
|
parameterizable => sub { $_[0]->members }, |
|
21
|
|
|
|
|
|
|
inflate => 0, |
|
22
|
|
|
|
|
|
|
}, |
|
23
|
|
|
|
|
|
|
]; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
MooX::Types::MooseLike::register_types($type_definitions, __PACKAGE__); |
|
26
|
|
|
|
|
|
|
our %EXPORT_TAGS = ('all' => \@EXPORT_OK); |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
MooX::Types::SetObject - Set::Object type |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
package MyPackage; |
|
39
|
|
|
|
|
|
|
use Moo; |
|
40
|
|
|
|
|
|
|
use MooX::Types::MooseLike::Base qw(Int); |
|
41
|
|
|
|
|
|
|
use MooX::Types::SetObject qw(SetObject); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# a Set::Object of integers |
|
44
|
|
|
|
|
|
|
has "int_objects" => ( |
|
45
|
|
|
|
|
|
|
isa => SetObject[Int], |
|
46
|
|
|
|
|
|
|
); |