Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding the API Document.
  • Loading branch information
Talina06 committed Jul 1, 2014
1 parent ae2249e commit 70ccef4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lib/MetaCPAN/Document/Stargazer.pm
@@ -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.

Copy link
@oalders

oalders Jul 3, 2014

Member

I'd rather see us importing just what we need rather than :all. It's much less confusing that way.

use MetaCPAN::Util;

has id => (
is => 'ro',
id => [qw(user module)],
);

has [qw(author release user module)] => (

This comment has been minimized.

Copy link
@oalders

oalders Jul 3, 2014

Member

Is there any reason not to assign "isa" to these attributes?

is => 'ro',
required => 1,
);

has date => (
is => 'ro',
required => 1,
isa => 'DateTime',

This comment has been minimized.

Copy link
@oalders

oalders Jul 3, 2014

Member

We should add our own custom type for DateTime.

default => sub { DateTime->now },
);

has timestamp => (
is => 'ro',
timestamp => { path => 'date', store => 1 },
);

__PACKAGE__->meta->make_immutable;

0 comments on commit 70ccef4

Please sign in to comment.