start to test symlink code, break it utterly
[engit/Iron-Munger.git] / lib / IronMunger / Monger.pm
1 use MooseX::Declare;
2
3 class IronMunger::Monger {
4
5   use MooseX::Types::Moose qw(ArrayRef Str);
6   use IronMunger::Calculate qw(:all);
7   use aliased 'IronMunger::Post';
8   use signatures;
9
10   has name => (is => 'ro', isa => Str, required => 0, predicate => 'has_name');
11   has nick => (is => 'ro', isa => Str, required => 0, predicate => 'has_nick');
12
13   has posts => (
14     is => 'ro', isa => ArrayRef[Post], required => 1,
15     default => sub { [] },
16   );
17
18   has post_count => (
19     is => 'ro', lazy => 1,
20     default => sub ($self) { successful_sequential_posts(@{$self->posts}) },
21   );
22
23   has days_left => (
24     is => 'ro', lazy => 1,
25     default => sub ($self) { days_remaining_to_post(@{$self->posts}) },
26   );
27
28   has level => (
29     is => 'ro', lazy => 1,
30     default => sub ($self) { level_for_post_count($self->post_count) }
31   );
32 }
33
34 1;