File Coverage

blib/lib/DBIx/Class/Schema/PopulateMore/Inflator.pm
Criterion Covered Total %
statement 7 8 87.5
branch n/a
condition n/a
subroutine 2 3 66.6
pod 2 2 100.0
total 11 13 84.6


line stmt bran cond sub pod time code
1             package DBIx::Class::Schema::PopulateMore::Inflator;
2              
3 3     3   2972 use Moo;
  3         23  
  3         17  
4              
5             =head1 NAME
6              
7             DBIx::Class::Schema::PopulateMore::Inflator - Base Class for keyword Inflators
8              
9             =head1 DESCRIPTION
10              
11             When L<DBIx::Class::Schema::PopulateMore::Command> executes, it uses a visitor object
12             (see L<DBIx::Class::Schema::PopulateMore::Visitor> to descend the key values of the
13             data hash that is used to put stuff into the given tables. If it finds a value
14             that matches a particular regexp, that means the value needs to be inflated and
15             it's passed to the inflating dispatcher, which finds the correct Inflator based
16             on the given namespace.
17              
18             =head1 ATTRIBUTES
19              
20             This class defines the following attributes.
21              
22             =head1 METHODS
23              
24             This module defines the following methods.
25              
26             =head2 name
27              
28             returns the name of this inflator. Should be something you expect to be unique
29             across all defined inflators. Defaults to something based on the namespace.
30              
31             =cut
32              
33             sub name
34             {
35 20     20 1 31 my $class = ref shift @_;
36 20         18 my $package = __PACKAGE__;
37 20         127 my ($name) = ($class =~m/^$package\:\:(.+)$/);
38            
39 20         42 return $name;
40             }
41              
42              
43             =head2 inflate($command, $string)
44              
45             This is called by L<DBIx::Class::Schema::PopulateMore::Command> dispatcher, when there
46             is a match detected by the visitor.
47              
48             =cut
49              
50             sub inflate
51             {
52 0     0 1   die "You forgot to implement ->inflate";
53             }
54              
55              
56             =head1 AUTHOR
57              
58             Please see L<DBIx::Class::Schema::PopulateMore> For authorship information
59              
60             =head1 LICENSE
61              
62             Please see L<DBIx::Class::Schema::PopulateMore> For licensing terms.
63              
64             =cut
65              
66              
67             1;