File Coverage

blib/lib/POE/Component/Server/Twirc/State.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package POE::Component::Server::Twirc::State;
2              
3 2     2   6 use Moose;
  2         2  
  2         13  
4 2     2   9105 use MooseX::Storage;
  2         37695  
  2         9  
5              
6             with Storage(format => 'JSON', io => 'File');
7              
8             has access_token => isa => 'Str', is => 'rw';
9             has access_token_secret => isa => 'Str', is => 'rw';
10              
11             has twitter_users => (
12             isa => 'HashRef',
13             default => sub { {} },
14             traits => [qw/Hash/],
15             handles => {
16             set_user_by_id => 'set',
17             get_user_by_id => 'get',
18             delete_user_by_id => 'delete',
19             get_users => 'values',
20             },
21             );
22              
23             has followers => (
24             isa => 'HashRef',
25             traits => [ qw/Hash/ ],
26             is => 'rw',
27             default => sub { {} },
28             handles => {
29             add_follower_id => 'set',
30             remove_follower_id => 'delete',
31             is_follower_id => 'exists',
32             },
33             );
34              
35             around add_follower_id => sub {
36             my ( $orig, $self, $id ) = @_;
37              
38             $self->$orig($id, undef);
39             };
40              
41             has followers_updated_at => is => 'rw', isa => 'Int', default => 0;
42              
43 2     2   529 no Moose;
  2         2  
  2         9  
44              
45             __PACKAGE__->meta->make_immutable;
46              
47             1;