File Coverage

blib/lib/EventStore/Tiny/Snapshot.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package EventStore::Tiny::Snapshot;
2              
3 7     7   544 use strict;
  7         12  
  7         147  
4 7     7   33 use warnings;
  7         12  
  7         364  
5              
6             use Class::Tiny {
7 1         10 state => sub {die "state is required.\n"},
8 1         7 timestamp => sub {die "timestamp is required.\n"},
9 7     7   370 };
  7         1268  
  7         64  
10              
11             sub BUILD {
12 30     30 0 7431 my $self = shift;
13              
14             # Check non-lazy
15 30         426 $self->state;
16 29         421 $self->timestamp;
17              
18             # Return nothing (will be ignored anyway)
19 28         111 return;
20             }
21              
22             1;
23              
24             =pod
25              
26             =encoding utf-8
27              
28             =head1 NAME
29              
30             EventStore::Tiny::Snapshot
31              
32             =head1 REFERENCE
33              
34             EventStore::Tiny::Snapshot implements the following attributes and methods.
35              
36             =head2 state
37              
38             my $state_hr = $snapshot->state;
39              
40             Returns the hashref representing the state of this snapshot.
41              
42             =head2 timestamp
43              
44             my $timestamp = $snapshot->timestamp;
45              
46             Returns a timestamp representing the time this snapshot was created.
47              
48             =head1 SEE ALSO
49              
50             L
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)
55              
56             Released under the MIT License (see LICENSE.txt for details).
57              
58             =cut