File Coverage

blib/lib/Net/Async/Github/RateLimit/Core.pm
Criterion Covered Total %
statement 6 12 50.0
branch n/a
condition n/a
subroutine 2 7 28.5
pod 5 5 100.0
total 13 24 54.1


line stmt bran cond sub pod time code
1             package Net::Async::Github::RateLimit::Core;
2              
3 3     3   329316 use strict;
  3         8  
  3         188  
4 3     3   42 use warnings;
  3         7  
  3         837  
5              
6             our $VERSION = '0.013'; # VERSION
7              
8             =head1 NAME
9              
10             Net::Async::Github::RateLimit::Core - represents the current user's rate limit
11              
12             =head1 METHODS
13              
14             =head2 new
15              
16             Instantiates.
17              
18             =cut
19              
20 0     0 1   sub new { my $class = shift; bless { @_ }, $class }
  0            
21              
22             =head2 limit
23              
24             Current limit as a number of remaining requests.
25              
26             =cut
27              
28 0     0 1   sub limit { shift->{limit} }
29              
30             =head2 remaining
31              
32             Number of remaining requests.
33              
34             =cut
35              
36 0     0 1   sub remaining { shift->{remaining} }
37              
38             =head2 reset
39              
40             When we expect the rate limit to be reset, as a UNIX epoch.
41              
42             =cut
43              
44 0     0 1   sub reset : method { shift->{reset} }
45              
46             =head2 seconds_left
47              
48             Number of seconds left before reset.
49              
50             =cut
51              
52 0     0 1   sub seconds_left { shift->reset - time }
53              
54             1;
55