File Coverage

blib/lib/Database/Async/ORM/Constraint.pm
Criterion Covered Total %
statement 6 18 33.3
branch n/a
condition 0 2 0.0
subroutine 2 10 20.0
pod 0 8 0.0
total 8 38 21.0


line stmt bran cond sub pod time code
1             package Database::Async::ORM::Constraint;
2              
3 2     2   248548 use strict;
  2         4  
  2         89  
4 2     2   7 use warnings;
  2         3  
  2         592  
5              
6             our $VERSION = '0.019'; # VERSION
7              
8             sub new {
9 0     0 0   my ($class, %args) = @_;
10 0           bless \%args, $class
11             }
12              
13 0     0 0   sub table { shift->{table} }
14 0     0 0   sub name { shift->{name} }
15 0     0 0   sub type { shift->{type} }
16              
17 0     0 0   sub is_deferrable { shift->{deferrable} }
18 0     0 0   sub is_deferred { shift->{initially_deferred} }
19              
20             sub fields {
21 0     0 0   my ($self) = @_;
22 0   0       map { $self->table->field_by_name($_) } ($self->{fields} //= [])->@*
  0            
23             }
24              
25             sub references {
26 0     0 0   my ($self) = @_;
27 0           $self->table->schema->table_by_name($self->{references}{table});
28             }
29              
30             1;
31