File Coverage

blib/lib/Story/Interact/Character.pm
Criterion Covered Total %
statement 21 25 84.0
branch n/a
condition n/a
subroutine 8 11 72.7
pod 0 1 0.0
total 29 37 78.3


line stmt bran cond sub pod time code
1 5     5   86 use 5.010001;
  5         16  
2 5     5   22 use strict;
  5         12  
  5         104  
3 5     5   40 use warnings;
  5         21  
  5         356  
4              
5             package Story::Interact::Character;
6              
7             our $AUTHORITY = 'cpan:TOBYINK';
8             our $VERSION = '0.001012';
9              
10 5     5   2999 use Moo;
  5         58020  
  5         33  
11 5     5   10106 use Types::Common -types;
  5         1290389  
  5         47  
12 5     5   74487 use namespace::clean;
  5         62081  
  5         46  
13              
14             use overload (
15 0     0   0 q[bool] => sub { 1 },
16 0     0   0 q[""] => sub { shift->name },
17 5         88 fallback => 1,
18 5     5   5022 );
  5         29  
19              
20             has 'name' => (
21             is => 'ro',
22             isa => NonEmptyStr,
23             required => 1,
24             );
25              
26             has 'location' => (
27             is => 'rwp',
28             isa => Str | Undef,
29             );
30              
31             has [ qw( meta knows carries achieved ) ] => (
32             is => 'ro',
33             isa => HashRef,
34 40     40   23634 builder => sub { {} },
35             );
36              
37             sub TO_JSON {
38 0     0 0   +{ %{ +shift } };
  0            
39             }
40              
41             1;