Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adding the API Document.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package MetaCPAN::Document::Stargazer; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Moose; | ||
use ElasticSearchX::Model::Document; | ||
|
||
use DateTime; | ||
use MetaCPAN::Types qw(:all); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
use MetaCPAN::Util; | ||
|
||
has id => ( | ||
is => 'ro', | ||
id => [qw(user module)], | ||
); | ||
|
||
has [qw(author release user module)] => ( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
is => 'ro', | ||
required => 1, | ||
); | ||
|
||
has date => ( | ||
is => 'ro', | ||
required => 1, | ||
isa => 'DateTime', | ||
This comment has been minimized.
Sorry, something went wrong. |
||
default => sub { DateTime->now }, | ||
); | ||
|
||
has timestamp => ( | ||
is => 'ro', | ||
timestamp => { path => 'date', store => 1 }, | ||
); | ||
|
||
__PACKAGE__->meta->make_immutable; |
I'd rather see us importing just what we need rather than :all. It's much less confusing that way.