line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Types::Set::Object; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$MooseX::Types::Set::Object::VERSION = '0.04'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# git description: MooseX-Types-Set-Object-0.03-11-g7907c3a |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
1
|
|
|
1
|
|
19767
|
$MooseX::Types::Set::Object::AUTHORITY = 'cpan:NUFFIN'; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
# ABSTRACT: Set::Object type with coercions and stuff. |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
486
|
use MooseX::Types; |
|
1
|
|
|
|
|
382935
|
|
|
1
|
|
|
|
|
6
|
|
13
|
1
|
|
|
1
|
|
2940
|
use MooseX::Types::Moose qw(Object ArrayRef); |
|
1
|
|
|
|
|
11588
|
|
|
1
|
|
|
|
|
8
|
|
14
|
1
|
|
|
1
|
|
4602
|
use Set::Object (); |
|
1
|
|
|
|
|
6016
|
|
|
1
|
|
|
|
|
87
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
class_type "Set::Object"; # FIXME not parameterizable |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
coerce "Set::Object", |
19
|
|
|
|
|
|
|
from ArrayRef, |
20
|
|
|
|
|
|
|
via { Set::Object->new(@$_) }; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
coerce ArrayRef, |
23
|
|
|
|
|
|
|
from "Set::Object", |
24
|
|
|
|
|
|
|
via { [$_->members] }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=for :stopwords ×××× ×§××'×× (Yuval Kogman) Yuval Kogman Florian Ragwitz Karen Etheridge |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
MooseX::Types::Set::Object - Set::Object type with coercions and stuff. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 VERSION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
version 0.04 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package Foo; |
47
|
|
|
|
|
|
|
use Moose; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use MooseX::Types::Set::Object; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has children => ( |
52
|
|
|
|
|
|
|
isa => "Set::Object", |
53
|
|
|
|
|
|
|
accessor => "transition_set", |
54
|
|
|
|
|
|
|
coerce => 1, # also accept array refs |
55
|
|
|
|
|
|
|
handles => { |
56
|
|
|
|
|
|
|
children => "members", |
57
|
|
|
|
|
|
|
add_child => "insert", |
58
|
|
|
|
|
|
|
remove_child => "remove", |
59
|
|
|
|
|
|
|
# See Set::Object for all the methods you could delegate |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# ... |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $foo = Foo->new( children => [ @objects ] ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$foo->add_child( $obj ); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 DESCRIPTION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This module provides a Moose type constraint (see |
72
|
|
|
|
|
|
|
L<Moose::Util::TypeConstraints>, L<MooseX::Types>). |
73
|
|
|
|
|
|
|
Note that this constraint and its coercions are B<global>, not simply limited to the scope that |
74
|
|
|
|
|
|
|
imported it -- in this way it acts like a regular L<Moose> type constraint, |
75
|
|
|
|
|
|
|
rather than one from L<MooseX::Types>. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 TYPES |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=over 4 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item Set::Object |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
A subtype of C<Object> that isa L<Set::Object> with coercions to and from the |
84
|
|
|
|
|
|
|
C<ArrayRef> type. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SEE ALSO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L<Set::Object>, L<MooseX::AttributeHandlers>, L<MooseX::Types>, |
91
|
|
|
|
|
|
|
L<Moose::Util::TypeConstraints> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 AUTHOR |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
×××× ×§××'×× (Yuval Kogman) <nothingmuch@woobling.org> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Yuval Kogman. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
102
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=over 4 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Yuval Kogman <nothingmuch@woobling.org> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=back |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |