Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (25 sloc) 0.657 kB
5fe8ebb @rafl Add a distribution document
rafl authored
1 package MetaCPAN::Document::Distribution;
2
3 use Moose;
4 use ElasticSearchX::Model::Document;
c413bdc @rafl Make the bug summaries less restrictive
rafl authored
5 use MetaCPAN::Types qw(BugSummary);
e150336 @monken index all available meta data from rt bug report
monken authored
6 use MooseX::Types::Moose qw(ArrayRef);
5fe8ebb @rafl Add a distribution document
rafl authored
7 use namespace::autoclean;
8
345566e @monken perltidy
monken authored
9 has name => ( is => 'ro', required => 1, id => 1 );
e150336 @monken index all available meta data from rt bug report
monken authored
10 has bugs => (
11 is => 'rw',
c413bdc @rafl Make the bug summaries less restrictive
rafl authored
12 isa => ArrayRef[BugSummary],
e150336 @monken index all available meta data from rt bug report
monken authored
13 lazy => 1,
14 default => sub { [] },
15 dynamic => 1,
16 );
17
18 sub add_bugs {
19 my ( $self, $add ) = @_;
c413bdc @rafl Make the bug summaries less restrictive
rafl authored
20 BugSummary->assert_valid($add);
e150336 @monken index all available meta data from rt bug report
monken authored
21 my $bugs = {
c413bdc @rafl Make the bug summaries less restrictive
rafl authored
22 ( map { $_->{source} => $_ } @{ $self->bugs } ),
23 $add->{source} => $add,
e150336 @monken index all available meta data from rt bug report
monken authored
24 };
25 $self->bugs( [ values %$bugs ] );
26 }
5fe8ebb @rafl Add a distribution document
rafl authored
27
28 __PACKAGE__->meta->make_immutable;
29
30 1;
Something went wrong with that request. Please try again.